Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You'll need to figure out the actual URL.</p> <p>Option 1a: Open the page in a browser with good developer support (e.g. firefox with the web development tools) and look through the source to find where <code>_doPostBack</code> is defined. Figure out what URL it's constructing. Note that it might not be in the main page source, but instead in something that the page loads.</p> <p>Option 1b: Ditto, but have ruby do it. If you're fetching the page with Net:HTTP you've got the tools to find the definition of <code>__doPostBack</code> already (the body as a string, ruby's grep, and the ability to request additional files, such as those in script tags).</p> <p>Option 2: Monitor the traffic between a browser and the page (e.g. with a logging proxy) to find out what the URL is.</p> <p>Option 3: Ask the owner of the web page.</p> <p>Option 4: Guess. This may not be as bad as it sounds (e.g. if the original URL ends with "...?page=1" or something) but in general this is the least likely to work. </p> <p>Edit (in response to your comment on the other question):</p> <p>Assuming you're using the Net:HTTP library, you can do a postback by just replacing your <code>get</code> with a <code>post</code>, e.g. <code>my_http.post(my_url)</code> instead of <code>my_http.get(my_url)</code></p> <p>Edit (in response to danieltalsky's answer):</p> <p><strong>watir</strong> may be a really good solution for you (I'm kicking myself for not having thought of it), but be aware that you may have to <a href="http://wiki.openqa.org/display/WTR/JavaScript" rel="nofollow noreferrer">manually fire the event</a> or go through other hoops to get what you want. As a specific gotcha, with any asynchronous fetch like this you need to make sure that the full response has come back before you scrape it; that isn't a problem when you're doing the request inline yourself.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload