lucas9

Getting source code of a website using IE.au3

9 posts in this topic

i am using IE.au3 in order to get the source code of a website. this is my code:

local $html = _IEDocReadHTML($oIE)
FileWrite("C:\\test.txt",$html & @CRLF)

 

if i open internet explorer and i click right mouse button -> "view source code of the page" the code shown is different than the code shown by autoit script.

¿anyone knows any solution? ¿am i using the right function?

 

Regards and thanks

Share this post


Link to post
Share on other sites



PD: i need the code that shows internet explorer.

Share this post


Link to post
Share on other sites

Are you sure that the URL that you are viewing matches what is in the autoit script exactly?  If not, I would update the autoit script with the URL you copy and paste from the page whose source files you are viewing and try again. What parts are different? To troubleshoot the issue, I would copy the source code that you are seeing when you select "view source code of the page" and paste that into a seperate txt file and save it, then use a file comparison application to compare the two files to see exactly what content is not being read by autoit.

Share this post


Link to post
Share on other sites
16 minutes ago, lucas9 said:

.....  the code shown is different than the code shown by autoit script .....

.... as indeed stated in the 'Remarks' of the _IEDocReadHTML() help file


small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites
16 minutes ago, l3ill said:

Too bad..

InetGet works better IMO...

Thanks. this function returns the code that i need.

 

1 minute ago, Chimp said:

.... as indeed stated in the 'Remarks' of the _IEDocReadHTML() help file

right. i haven't read it.

 

Solved! thanks to everyone

Share this post


Link to post
Share on other sites

InetGet() saves the returned data in a disk file; You can also use InetRead() if you want returned data stored in a variable instead...


small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites
1 minute ago, Chimp said:

InetGet() saves the returned data in a disk file; You can also use InetRead() if you want returned data stored in a variable instead...

hehe. just now i was writing code in order to put the code given by InetGet() in a variable.

 

THX

Share this post


Link to post
Share on other sites

;)


small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

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