Jump to content

Read html source


Recommended Posts

OK I have I have my program that submit a form to a website. Now before _IEQuit($oIE) I would like for the program to copy the text on two lines at the bottom of the site that start with <!--- and end with --->. Once it copy it to write it to a file. I have no idea how i can do this.

any help will be greatly appreciated thanks

Link to comment
Share on other sites

  • Moderators

Hi, OrlandoAmador. Have you checked out the functions for reading HTML in the help file (IEBodyReadHTML, IEDocReadHTML, etc.)? If so, can you please post what you've tried thus far so we can attempt to assist? :)

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

If you're intending this program to be distributed, I'd recommend you not use IE because as I've found, a few people like to remove IE for some resone :/

My point is to use inet or winhttp if you're going to distribute this.

Edited by FlutterShy
Link to comment
Share on other sites

Hi, OrlandoAmador. Have you checked out the functions for reading HTML in the help file (IEBodyReadHTML, IEDocReadHTML, etc.)? If so, can you please post what you've tried thus far so we can attempt to assist? :)

Ok I look throw and understand both examples on the help files. My problem is that i can not seem to narrow down the results for both of them. In IEBodyReadHTML I can not seem to find a way to say look in between <div id=code> 123456 </div> and only copy the 123456 without coping the entire HTML code. Same thing is happing with IEDocReadHTML. I know their is something that I am missing but I just can find it.

If you're intending this program to be distributed, I'd recommend you not use IE because as I've found, a few people like to remove IE for some resone :/

My point is to use inet or winhttp if you're going to distribute this.

I just started using Autoit and starting to really like it. The problem is for me and two other people. But I will look into winhttp and many start trying something with it to learn more, but thanks alot for you opinion.

Link to comment
Share on other sites

Use _StringBetween (from String.au3) or more elegantly, use:

$oDiv = _IEGetObjById($oIE, "code")
$sText = _IEPropertyGet($oDiv, "innertext")

Dale

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

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...