Normal Topic @httpgethtml question (Read 1056 times)
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
@httpgethtml question
Aug 6th, 2007 at 8:57pm
Print Post Print Post  
When I use @httpgethtml with www.number1expert.com I do not get the html code, I get an  Invalid Hostname error.
Can someone please point out what  I have wrong in my code below?

Thanks

www.number1expert.com/California/La-Jolla/index.html ; from a browser gets me to the correct page

var bb as String


             bb = @httpgethtml("www.number1expert.com","/California/La-Jolla/index.html","bs@usa.net",80)
     FileOverwrite("realtor.txt", bb)

This is what I get in my file instead of the page html code.
<h1>Bad Request (Invalid Hostname)</h1>
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1350
Location: New Hampshire
Joined: Mar 11th, 2003
Re: @httpgethtml question
Reply #1 - Aug 7th, 2007 at 5:20am
Print Post Print Post  
I see the same problem, too.

HTTPGetHTML() seems to have a problem when there is a number "1" in the server name.

For example, "www.number1.com" fails, whereas "www.numberone.com" works.

Also, "www.lyrics007.com" and "www.sing365.com" both work.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @httpgethtml question
Reply #2 - Aug 8th, 2007 at 3:02pm
Print Post Print Post  
It has nothing to do with the URL. The server where this website resides is forcing the HTTP 1.1 protocol which requires an additional host header to be sent with each request. The upcoming 2.0 update is already packed, but the next one will send the  additional header that this web server wants. Is accessing this site an immediate requirement, Robert?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: @httpgethtml question
Reply #3 - Aug 8th, 2007 at 3:55pm
Print Post Print Post  
Hammer wrote on Aug 8th, 2007 at 3:02pm:
Is accessing this site an immediate requirement, Robert?


No. Rush.  Smiley

I used a different method and am getting the info I need just fine.

Besides it looks like it is going to take me a long time to figure out how to process the returned data. I have manually taken the HTML code I would get back from @httpgethtml and started working on figuring out how I am going to parse out the data I need. I have been using @httpgethtml  a lot and have had great results when I am looking for set specific data like a ship date and tracking number. On this one each request to the website gives me varying amount of data back depending on what it finds, so I will need to figure out how to loop through it and format It for processing. I have been using regex with my other simple @httpgethtm routines but I might be more comfortable using Sbasic read file commands on this one.

Erika thanks for letting us know what was wrong and Carl thanks for the help and validating that I was not off in left field again.

Robert
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @httpgethtml question
Reply #4 - Aug 8th, 2007 at 4:03pm
Print Post Print Post  
BOBSCOTT wrote on Aug 8th, 2007 at 3:55pm:
I have been using regex with my other simple @httpgethtml routines

Cool! Go, Robert, go!
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged