Jump to content

Viewing Generated Source Using HTTP.au3


ame1011
 Share

Recommended Posts

Hi there, I'm making an application that retrieves all relevant information from

http://www.tv.com/heroes/show/17552/summary.html

Of course not just for this show, any other shows in the database as well.

In the past I've done this with the IE.au3 UDF and it worked well for me. However, this time around I'm using the HTTP UDF and would like to skip IE completely.

The problem with this site is that all the information about a show is loaded using AJAX.

Viewing the source using HTTP requests does not give me what I'm looking for, I get the source before javascript kicks in.

I even tried switching using agents to IE 5.0 and it doesn't help. Anyone have any ideas? A 30min search on the forums returned nothing for me =(

-Thanks in advance

[font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font]
Link to comment
Share on other sites

Please don't bump within 24 hours of your previous post. I'm not personally familiar with the http UDF but could you not put a sleep in to wait an aproximate time then retrieve the source after javascript has kicked in?

Link to comment
Share on other sites

sorry about the bump, was anxious to continue working on my script.

I avoid sleeps in 99% of my scripts, there is always a more reliable way. I would be at the mercy of the network speed. Thanks for the suggestion, it's the first thing I thought of as well actually.

[font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font]
Link to comment
Share on other sites

Can you use _InetGetSource() and parse out the information?

#include<Inet.au3>
$Source = _INetGetSource("http://www.tv.com/heroes/show/17552/summary.html")
Thanks, it seems INetGetSource is more what i was looking for, rather than http.au3. However the div containing the search results is still blank

CODE
<div id="search_results" class="body"></div>
[font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font]
Link to comment
Share on other sites

Ajax relies on client-side Javascript to do what it does. Without a browser, there is no client-side, there is no Javascript interpreter, game over.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Ajax relies on client-side Javascript to do what it does. Without a browser, there is no client-side, there is no Javascript interpreter, game over.

Dale

Dale you just shattered my dreams, lol.

Thanks for the info, I think I'll just include a browser on one of the tabs in my program and just use that to retrieve info and allow the user access to it as well. I never liked how hidden IE windows are handled especially in vista so I'll go about it in this manner. At least im still not waiting for a solution that wasn't possible :).

[font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font]
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...