AutoHotkey Community

It is currently May 27th, 2012, 10:04 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: August 17th, 2009, 11:44 pm 
im looking for a way to get the source code of a webpage, and then gathering all the urls from it, and then narrowing down those urls to only the ones that begin with "href=". And finally storing those in a text file, line by line.

Its a big task i Know, i was looking around and think a function called httpquery might have something to do with accomplishing this task but am not sure. If anyone could point me in the right direction i'd really appreciate it.

Thanks


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 17th, 2009, 11:57 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
You should be able to accomplish that with UrlDownloadToFile and RegExMatch.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 18th, 2009, 12:00 am 
thanks, that was very helpful, much appreciated.

How would i go about storing the current webpage (embedded in my gui) to a variable so i can use the functions you listed above


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 18th, 2009, 12:07 am 
ehm UrlDownloadToFile does save into a file
and all u need to do is read the text file as a variable


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 18th, 2009, 12:17 am 
sorry, maybe i wasnt clear enough let me rephrase

UrlDownloadToFile, URL, Filename

I want to store the webpage that my browser is currently on to a variable such as %MyUrl% and then insert that in place of "URL". There is no way to predict the address of the webpage until it is loaded. So, that is why i need to store it to a variable and then call it into the function so...

ex:

UrlDownloadToFile, %MyURL%, Filename

thanks in advance


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 18th, 2009, 12:17 am 
by webpage i mean url ^^^^


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 18th, 2009, 4:08 am 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
Are you using IE? If so this should work:
Code:
COM_Init()
pwb := GetWebBrowser()
URL := COM_Invoke(pwb, "document.url")
COM_Release(pwb), COM_Term()
Requires COM Lib & Sean's GetWebBrowser().

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Maestr0, specter333, Yahoo [Bot] and 65 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group