Jump to content

grab html source?


Recommended Posts

I see what you were saying now - sorry a bit dense today. Yes, it will make use of any cookies that you have not cleaned/cleared out.

ok i have tried it on three sites now, it works on IP boards, VB boards, but for some reason if you try to use it on myspace it logs you out and gives you an error. any idea on what myspace is doing?
Link to comment
Share on other sites

#include <INet.au3>

$source = _INetGetSource("http://www.autoitscript.com/forum/index.php?showuser=1")
$status = (StringInStr($source, "You are not logged in, you may log in below") = False)

ClipPut($source)
MsgBox(64, "finished", "Logged in : " & $status & @CRLF & "Source added to clipboard...")

EDIT : oh...MySpace ? "I know nothing."

Edited by Helge
Link to comment
Share on other sites

So if you want to do this with IE.au3, you can do this:

#include <IE.au3>
$tryAttach = False
$visible = False
$oIE = _IECreate("http://www.myspace.com", $tryAttach, $visible)
; if you aren't where you want to be, click, fill out forms etc.
$body = _IEBodyReadHTML($oIE) ; or use _IEDocReadHTML for the full HTML
_IEQuit($oIE) ; if you don't quit you leave a zombie IE process

Dale

BTW, cookies and their values are stored on your machine and are sent as part of the request header by the browser when the domain stored with the cookie matches the domain of the requested URL

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

So if you want to do this with IE.au3, you can do this:

#include <IE.au3>
$tryAttach = False
$visible = False
$oIE = _IECreate("http://www.myspace.com", $tryAttach, $visible)
; if you aren't where you want to be, click, fill out forms etc.
$body = _IEBodyReadHTML($oIE) ; or use _IEDocReadHTML for the full HTML
_IEQuit($oIE) ; if you don't quit you leave a zombie IE process

Dale

BTW, cookies and their values are stored on your machine and are sent as part of the request header by the browser when the domain stored with the cookie matches the domain of the requested URL

yea i dont understand why this task works with IE.au3 and not INet.au3
Link to comment
Share on other sites

guess not

Nope, but I'm glad the IE.au3 example works. You're welcome.

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

  • Moderators

Nope, but I'm glad the IE.au3 example works. You're welcome.

Dale

:)

Amazing isn't it... People just take things for granted too often.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Nope, but I'm glad the IE.au3 example works. You're welcome.

Dale

I have many things coded with the IE.au3 and i thank you for that, but im looking for a function that acts like inetgetsource without actually processing it, or processing it as a txt file?

Edited by blizzedout
Link to comment
Share on other sites

  • Moderators

You've been given several options.

If you are having an issue with them, but InetGet() works, why not just encrypt the file once it's written to if you are that paranoid that it may be found?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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