How to scrap text from internet in VB

Visual Basic Topics
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: How to scrap text from internet in VB

Post by Neo » Wed Sep 28, 2011 11:53 pm

:?: How use POST method?

Code: Select all

	Dim req As XMLHTTP
	Set req = New XMLHTTP
	req.open "POST", "https://robot.lk/viewtopic.php", False
	req.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
	req.send "f=9&p=8633"
	Text1.Text = req.responseText
User avatar
Rksk
Major
Major
Posts: 730
Joined: Thu Jan 07, 2010 4:19 pm
Location: Rathnapura, Sri Lanka

Re: How to scrap text from internet in VB

Post by Rksk » Thu Sep 29, 2011 12:42 am

Thank you. :)
User avatar
Rksk
Major
Major
Posts: 730
Joined: Thu Jan 07, 2010 4:19 pm
Location: Rathnapura, Sri Lanka

Re: How to scrap text from internet in VB6

Post by Rksk » Sat Oct 08, 2011 12:01 pm

Neo wrote:

Code: Select all

	Dim req As XMLHTTP
	Set req = New XMLHTTP
	req.open "GET", "https://robot.lk/index.php", False
	req.send ""
	Text1.Text = req.responseText
This works fine with remote hosts. But doesn't work with localHost. how do I resolve?

Thankz.

[ Post made via Mobile Device ] Image
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: How to scrap text from internet in VB

Post by Neo » Sun Oct 09, 2011 5:36 pm

Should work. Can you provide more details on the command line you use and the web server you are running.
If you are running WAMP, http://localhost/myfile.php should work. Be sure to use http:// prefix.
User avatar
Rksk
Major
Major
Posts: 730
Joined: Thu Jan 07, 2010 4:19 pm
Location: Rathnapura, Sri Lanka

Re: How to scrap text from internet in VB

Post by Rksk » Mon Oct 10, 2011 8:34 am

vb errror2.jpg
vb errror2.jpg (94.97 KiB) Viewed 10972 times
[ Post made via Mobile Device ] Image
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: How to scrap text from internet in VB

Post by Neo » Mon Oct 10, 2011 3:11 pm

Worked on the first run!
I can't guess anything without seeing your code.
lh.PNG
lh.PNG (22.12 KiB) Viewed 10968 times
User avatar
Rksk
Major
Major
Posts: 730
Joined: Thu Jan 07, 2010 4:19 pm
Location: Rathnapura, Sri Lanka

Re: How to scrap text from internet in VB

Post by Rksk » Wed Oct 12, 2011 12:26 pm

Yes, I found the error.

The computer must be connected to the internet to call localhost too.
It doesn't work, Without an internet connection.

I tried with Xampp. I don't know where is the problem.

[ Post made via Mobile Device ] Image
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: How to scrap text from internet in VB

Post by Neo » Wed Oct 12, 2011 12:45 pm

Try WAMP. It might work without an internet connection.
Post Reply

Return to “Visual Basic Programming”