Sign in to follow this  
Followers 0
Benji

IE Library in AutoIt

21 posts in this topic

#1 ·  Posted (edited)

Having spoken to locodarwin, he advised me to put a post up in here asking for help with IE Library in AutoIt.

My question involves the site CLICKY!!!. The area with I have highlighted in the following picture, as seen HERE is the area I am focusing on.

I basically want to extract that information into Microsoft Excel. That is step one.

If I can get this done, step two is slightly more difficult. If you visit the above site, you can login with my test account, Username: testage Password: test123, and click on any one of the odds available by any of the bookmakers, you will see this bring up a betting slip. I'm told its possible to do but I personally have no idea how to go about it. I would like the cells in Excel to link to the corresponding betting slips.

I'm not great on AutoIt as it is, so please keep any responses to a n00b minimum

Many thanks

Edited by Benji

Share this post


Link to post
Share on other sites



If you're new to the IE library, start with

$url = "whatever"
$oIE = _IECreate($url, 1)
$clip = _IEDocReadHTML($oIE)
ClipPut($clip)
Run("Notepad.exe")
Send("^v")
oÝ÷ Ù6¤y©h¢F­¶¬¢êÜy©Ýuë^®h§{^­ì¨º·^²*Þv)ߢ¹¶*'À%µêçjدz¢*.${az¥¥ø¥z+l,Ê¡£¨¹Æ§ëbú+«b¢v¢ë_­©±ú+Ç­pLZ^jëh×6
#include <IE.au3>
$oIE = _IE_Example ("frameset")
$oFrames = _IEFrameGetCollection ($oIE)
$iNumFrames = @extended
For $i = 0 to ($iNumFrames - 1)
    $oFrame = _IEFrameGetCollection ($oIE, $i)
    MsgBox(0, "Frame Name", $oFrame.name)
Next

Try working your way down to the information you want, so you can ask more specific questions. I hope that helps and wasn't redundant to stuffs you already knew ;)


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

If you're new to the IE library, start with

$url = "whatever"
$oIE = _IECreate($url, 1)
$clip = _IEDocReadHTML($oIE)
ClipPut($clip)
Run("Notepad.exe")
Send("^v")
 oÝ÷ Ù6¤y©h¢F­¶¬¢êÜy©Ýuë^®h§{^­ì¨º·^²*Þv)ߢ¹¶*'À%µêçjدz¢*.${az¥¥ø¥z+l,Ê¡£¨¹Æ§ëbú+«b¢v¢ë_­©±ú+Ç­pLZ^jëh×6
#include <IE.au3>
$oIE = _IE_Example ("frameset")
$oFrames = _IEFrameGetCollection ($oIE)
$iNumFrames = @extended
For $i = 0 to ($iNumFrames - 1)
    $oFrame = _IEFrameGetCollection ($oIE, $i)
    MsgBox(0, "Frame Name", $oFrame.name)
Next
 oÝ÷ Ù:òÂäx2¢êðk'{h¶¢ú+«b¢|¨»§¶Ê2¢ç«$Þ²øªç¬¶*'°h¥ëajØ^ܲ}ý¶·ºwZÛh²Û~̨¹©ky§rw°?ú®¢×¢é]Ø­m騭éb殶­s`¢b33c·W&ÂÒgV÷C·vFWfW"gV÷C°¢b33c¶ôRÒôT7&VFRb33c·W&¢b33c¶6ÆÒôT&öG&VDDÔÂb33c¶ôR¤6ÆWBb33c¶6Æ¥'VâgV÷C´æ÷FWBæWRgV÷C²¥6VæBgV÷CµçbgV÷C²

# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I've got to be honest, i cant even get the first script to work when i put in a URL into the first line :s I get an error on line 2

I'm not very good at this

Edited by Benji

Share this post


Link to post
Share on other sites

I get error with that tested script.

Line 2799 (File "C:\Program Files \AutoIt3\Include\IE.au3"):

Return HWnd($o_object.HWND ())

Return ^ ERROR

Error: The requested action with this object failed.

Share this post


Link to post
Share on other sites

i actually got a warning.. not an error/crash with this line

$oIE = _IECreate($url, 1)

the "1" above say to "attach" an existing IE object

try the script above 1 more time

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Wouldnt it be more like

$url = "whatever"
$oIE = _IECreate($url, 1)
$clip = _IEBodyReadHTML($oIE)
ClipPut($clip)
Run("Notepad.exe")
Send("^v")
@ AzKay: Either IEBodyReadHTML or IEDocReadHTML is appropriate. I prefer looking at the full source code given from IEDocReadHTML, just for completeness. And yes, I did forget a #include <IE.au3> on my first post there.

@ Benji: Try running your script through Scite if you aren't already.


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

No i am still getting errors. This is beyond me, i know how to do a few very basic things with AutoIt. I am willing to learn its just i'm on a bit of a deadline to get this done. Anyone wanna job?

Share this post


Link to post
Share on other sites

No i am still getting errors. This is beyond me, i know how to do a few very basic things with AutoIt. I am willing to learn its just i'm on a bit of a deadline to get this done. Anyone wanna job?

Are you running the lastest version of AutoIt?


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

Are you running the lastest version of AutoIt?

Yes i've just redownloaded the latest version off the website again and i still get the same error

Share this post


Link to post
Share on other sites

@ AzKay: Either IEBodyReadHTML or IEDocReadHTML is appropriate. I prefer looking at the full source code given from IEDocReadHTML, just for completeness. And yes, I did forget a #include <IE.au3> on my first post there.

@ Benji: Try running your script through Scite if you aren't already.

Ah

# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

Yes i've just redownloaded the latest version off the website again and i still get the same error

Please run the script through Scite, post the exact script you use, and the console output with errors.


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

Please run the script through Scite, post the exact script you use, and the console output with errors.

Right i've made progress, i've finally got your script to work! I had half of an old script in there :s

Thats a whole lot date that gets put into notepad. It seems like a tall order trying to put the selected area i want into Excel ;)

Share this post


Link to post
Share on other sites
http://www.autoitscript.com/forum/index.ph...st&p=271533 contains a link to the IE Dev Toolbar. It has a 'select element by click' option that is sometimes useful. But if you don't know the basics of HTML you may find this entire task difficult. Perhaps you should browse MSDN for basic HTML stuff first?

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

I do know HTML as i've made several websites, my problem is i don't know what to do with the information when putting it into autoit. Even if i could get the information in, gettings it to do what i want in Excel is a totally different story.

I'm not trying to be rude and unwilling to learn, its just i don't have the time at the moment to get this one done. Can anyone help please? It no scam i do pay, just ask Loco ;) Just contact me on MSN: jon@fcut.co.uk if interested

Edited by Benji

Share this post


Link to post
Share on other sites

I can attest to the fact that Jon/Benji will pay and/or donate to AutoIt in exchange for help. I'd throw some help in myself this time around, only I'm behind at work and on a strict time budget.

-S


(Yet Another) ExcelCOM UDF"A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly...[indent]...specialization is for insects." - R. A. Heinlein[/indent]

Share this post


Link to post
Share on other sites

I do know HTML as i've made several websites, my problem is i don't know what to do with the information when putting it into autoit. Even if i could get the information in, gettings it to do what i want in Excel is a totally different story.

I'm not trying to be rude and unwilling to learn, its just i don't have the time at the moment to get this one done. Can anyone help please? It no scam i do pay, just ask Loco ;) Just contact me on MSN: jon@fcut.co.uk if interested

I can take a closer look at this over the weekend, but not today.

I will tell you that your site is FULL of embedded frame after embedded frame... just getting to the right document container will be one of the biggest challenges.

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

I took a quick look at this last night, but there is so much cross-site scripting its not funny.

Share this post


Link to post
Share on other sites

Took another quick look... the content you are wanting is a java applet. This means, sorry, it is not accessible via normal means and the access to its content are controlled by defined interfaces specific to the applet (i.e. you need api documentation or sources to even figure out what CAN be done).

Sorry.


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  
Followers 0