| View previous topic :: View next topic |
| Author |
Message |
Benny-D
Joined: 29 Feb 2008 Posts: 93
|
Posted: Sun Jun 15, 2008 3:52 am Post subject: getting HTML source of a webpage without openning it |
|
|
| 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 |
|
 |
Red Hat Dude Guest
|
Posted: Sun Jun 15, 2008 4:03 am Post subject: |
|
|
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
|
|
| Back to top |
|
 |
Benny-D
Joined: 29 Feb 2008 Posts: 93
|
Posted: Mon Jun 16, 2008 4:43 pm Post subject: |
|
|
| Thank You!!! |
|
| Back to top |
|
 |
Benny-D
Joined: 29 Feb 2008 Posts: 93
|
Posted: Sun Jul 06, 2008 12:11 pm Post subject: |
|
|
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 |
|
 |
n-l-i-d Guest
|
Posted: Sun Jul 06, 2008 2:18 pm Post subject: |
|
|
| You can use cURL instead... |
|
| Back to top |
|
 |
Benny-D
Joined: 29 Feb 2008 Posts: 93
|
Posted: Sun Jul 06, 2008 3:39 pm Post subject: |
|
|
What is cURL?
I've looked through AHK Help file and didn't find it there. |
|
| Back to top |
|
 |
Mustang
Joined: 17 May 2007 Posts: 415 Location: England
|
Posted: Mon Jul 07, 2008 12:42 am Post subject: |
|
|
| Benny-D wrote: | | What is cURL? |
Have a read here: libcurl example |
|
| Back to top |
|
 |
Benny-D
Joined: 29 Feb 2008 Posts: 93
|
Posted: Mon Jul 07, 2008 7:30 pm Post subject: |
|
|
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 |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6804 Location: Pacific Northwest, US
|
Posted: Mon Jul 07, 2008 10:13 pm Post subject: |
|
|
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 |
|
 |
HugoV
Joined: 27 May 2007 Posts: 533
|
Posted: Mon Jul 07, 2008 10:21 pm Post subject: |
|
|
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 |
|
 |
Benny-D
Joined: 29 Feb 2008 Posts: 93
|
Posted: Tue Jul 08, 2008 2:35 pm Post subject: |
|
|
| 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 |
|
 |
Benny-D
Joined: 29 Feb 2008 Posts: 93
|
Posted: Tue Jul 08, 2008 2:38 pm Post subject: |
|
|
| 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 |
|
 |
Benny-D
Joined: 29 Feb 2008 Posts: 93
|
Posted: Tue Jul 08, 2008 3:05 pm Post subject: |
|
|
| 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 |
|
 |
Benny-D
Joined: 29 Feb 2008 Posts: 93
|
Posted: Tue Jul 08, 2008 3:23 pm Post subject: |
|
|
| 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 |
|
 |
|