Jump to content
Sign in to follow this  
buymeapc

How can I get search results from a webpage?

Recommended Posts

buymeapc

I can't seem to find an answer in the forums for my question.

Basically, I browse to a webpage (http://www.pcplanets.com/index.php?page=search&t=v&q=jem&x=0&y=0).

How do I obtain the search results in the javascript tables? I want to be able to put the search results into a text file in the end.

Thanks in advance.

Share this post


Link to post
Share on other sites
DaleHohm

_IETableWriteToArray

Dale

Edit: typo

Edited by DaleHohm

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

Share this post


Link to post
Share on other sites
buymeapc

Thanks for the reply, Dale, but I'm not quite sure how to use this function to retrieve the data from the javascript table on the web page and write it to a text file.

Could you explain, please?

Thank you

Share this post


Link to post
Share on other sites
DaleHohm

It's tough to help since I don't know your level of knowledge starting out and you haven't shown any code you've tried.

Please work through the examples for _IECreate and _IETableWriteToArray, read about arrays in the helpfile as well as the FOR NEXT loop construct and the FileOpen and FileWrite commands.

Dale

Edit: also search the forum for _IETableWriteToArray to see how others have used it

Edited by DaleHohm

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

Share this post


Link to post
Share on other sites
buymeapc

Ok, I've gotten a bit further thanks to your help, Dale.

So far, I have this code:

#include <IE.au3>
$oIE = _IECreate("www.pcplanets.com/index.php?page=search&t=v&q=jem&x=0&y=0", 0, 0)
$oTable = _IETableGetCollection($oIE, 60)
$aTableData = _IETableWriteToArray($oTable)
MsgBox(0,"", $aTableData[0][0])

This gives me the first 20, but there's a total of 24 items in the table. How do I add the rest to the list?

Thanks

Share this post


Link to post
Share on other sites
DaleHohm

I wouldn't suggest you set the page to be invisible until you are really comfortable with using these routines. When invisible, you must make certain that you also use _IEQuit or you can leave an invisible browser running as a zombie.

So that page only shows 20 rows in the table on the page you navigated to... what did you expect to happen? To get items 21-24 you'll need to navigate to the page containing that data and read it as you did here.

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

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.