AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

getting HTML source of a webpage without openning it
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Benny-D



Joined: 29 Feb 2008
Posts: 93

PostPosted: Sun Jun 15, 2008 3:52 am    Post subject: getting HTML source of a webpage without openning it Reply with quote

Is there any command in AHK that will allow me to get the source of a webpage (HTML code) by its URL without openning it in any browser like IE or Firefox?
Back to top
View user's profile Send private message
Red Hat Dude
Guest





PostPosted: Sun Jun 15, 2008 4:03 am    Post subject: Reply with quote

I imagine so, but I wouldn't know it.
What you need is a command to save a file from the internet onto your hard drive. A copy command or something. An Html file would be downloadable just like any other; right-click on a link and choose 'save target', and what you get is an html file (source).
Back to top
poo_noo



Joined: 08 Dec 2006
Posts: 107
Location: Sydney Australia

PostPosted: Sun Jun 15, 2008 4:12 am    Post subject: Reply with quote

probably look at

UrlDownloadToFile
http://www.autohotkey.com/docs/commands/UrlDownloadToFile.htm
and then

FileRead
http://www.autohotkey.com/docs/commands/FileRead.htm
_________________
Paul O
Back to top
View user's profile Send private message Visit poster's website
Benny-D



Joined: 29 Feb 2008
Posts: 93

PostPosted: Mon Jun 16, 2008 4:43 pm    Post subject: Reply with quote

Thank You!!!
Back to top
View user's profile Send private message
Benny-D



Joined: 29 Feb 2008
Posts: 93

PostPosted: Sun Jul 06, 2008 12:11 pm    Post subject: Reply with quote

I used UrlDownloadToFile command and
saved files as .txt - everything worked fine untill I tried doing
the same thing with a website where my password was needed.

For some reason it doesn't download an html source of a
page that I need, but instead downloads the code of a page,
in which I have to enter my password.

The problem is even if I enter my password and right after
that use UrlDownloadToFile to download
the html code of the needed page, it will still download the
''enter-the-password page'' instead. Why is it so? Does it mean
that I cannot do it away without using a web browser?
Back to top
View user's profile Send private message
n-l-i-d
Guest





PostPosted: Sun Jul 06, 2008 2:18 pm    Post subject: Reply with quote

You can use cURL instead...
Back to top
Benny-D



Joined: 29 Feb 2008
Posts: 93

PostPosted: Sun Jul 06, 2008 3:39 pm    Post subject: Reply with quote

What is cURL?
I've looked through AHK Help file and didn't find it there.
Back to top
View user's profile Send private message
Mustang



Joined: 17 May 2007
Posts: 415
Location: England

PostPosted: Mon Jul 07, 2008 12:42 am    Post subject: Reply with quote

Benny-D wrote:
What is cURL?

Have a read here: libcurl example
Back to top
View user's profile Send private message
Benny-D



Joined: 29 Feb 2008
Posts: 93

PostPosted: Mon Jul 07, 2008 7:30 pm    Post subject: Reply with quote

Thank you very much for this link, but I read all the posts there and went to the main cUrl page (http://curl.haxx.se/) and tried to download it, and after I downloded it, I couldn't install it.

I have extracted the downloaded zip file (curl-7.18.2.tar) and got several folders out of it with some subfolders and files in them, but none of them is named like ''install'' or ''setup''.

So I don't know how to install 'cURL' properly. (I read the whole front page and FAQ section of cURL website - to no avail). Can you please tell me how I should do it?
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6804
Location: Pacific Northwest, US

PostPosted: Mon Jul 07, 2008 10:13 pm    Post subject: Reply with quote

AFAIR, cURL isn;t really "installed" just unzip and run.

did you download a windows binary for cURL?
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
HugoV



Joined: 27 May 2007
Posts: 533

PostPosted: Mon Jul 07, 2008 10:21 pm    Post subject: Reply with quote

Go here:
http://www.paehl.com/open_source/index.php?CURL_7.18.2

Download libcurl.dll that's the only thing you need with the libcurl
example. But my bet is that it might be a bit too complicated
for you (dll calls) you might try to regular curl (exe) with command
line options.

Go to the download page http://curl.haxx.se/download.html
and get one of the Win32 - Generic issues, unzip and in the
BIN directory you will find curl.exe which you need.

There is plenty of documentation for curl. (Personally I prefer wget
which is similar to curl)
Back to top
View user's profile Send private message
Benny-D



Joined: 29 Feb 2008
Posts: 93

PostPosted: Tue Jul 08, 2008 2:35 pm    Post subject: Reply with quote

engunneer wrote:
did you download a windows binary for cURL?


I have downloaded ''curl and libcurl 7.18.2'', I don't know what ''binary'' means.
Back to top
View user's profile Send private message
Benny-D



Joined: 29 Feb 2008
Posts: 93

PostPosted: Tue Jul 08, 2008 2:38 pm    Post subject: Reply with quote

HugoV wrote:
... But my bet is that it might be a bit too complicated
for you (dll calls) you might try to regular curl (exe) with command
line options.


You are right, dll calls are still hard for me, so I will start from the basics.
Thank you for the links. I am researching them at the moment.
Back to top
View user's profile Send private message
Benny-D



Joined: 29 Feb 2008
Posts: 93

PostPosted: Tue Jul 08, 2008 3:05 pm    Post subject: Reply with quote

HugoV wrote:
Download libcurl.dll that's the only thing you need with the libcurl
example.


I have downloaded it and extracted it (the name of the file is ''curl_DLL_ONLY''). As a result I got two folders: one is called ''nossl'' with one file inside, and the other one is named ''SSL'' - also with only one file inside.

I also downloaded the ''FileHelper'' and extracted it (that's what I was tolod to do in the ''libcurl example'' thread at http://www.autohotkey.com/forum/topic22621.html), then I created one more AHk file and copied the code of the example itself into it.

The problem is whenever I try to run my newly-created ahk file I always get the a message saying ''error loading lib''. Why is it so?
( In the beginning I placed my newly-created ahk file and the ''FileHelper.ahk'' into ''nossl'' folder, then, after the failure - into ''SSL'' folder, but the result was still the same)
Back to top
View user's profile Send private message
Benny-D



Joined: 29 Feb 2008
Posts: 93

PostPosted: Tue Jul 08, 2008 3:23 pm    Post subject: Reply with quote

HugoV wrote:
... get one of the Win32 - Generic issues, unzip and in the
BIN directory you will find curl.exe which you need


I downoalded one of them and unzipped it -- actually, after the failure tried several times with different ones presented there on the list -- the problem is I always get a folder (named ''curl-7.18.2'') with ''empty'' files inside. I mean I can't open them for some reason. Their icons are ''empty ones'' - whenever I click on them, my system is asking me with which programm I would want to open those files.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group