You will then need to parse that html to get the data you want. Depending on how you do this, if the target site changes their html then you will need to re-code your site too.
Pls tel me step by step procedure i cnt understand ? i am new to dotnet and screen scraping... pls provide more details... and send me the procedure pls...
how to fetch data from other website in asp.net, i mean the search result is in one website then how to bring that search result to my form ?
If you are not owning both the websites, then getting search results will not be possible.
Say if there are 2 sites a.com and b.com:
1. If you own both the sites, then use Iframe in your website to display the search result.
2. You can also use http GET & POST method to transact between the two sites.
If you want to get data from a.com into b.com but you only own (manage) b.com, then you cannot get search results. But you can get content from that page by doing html parsing of the page.
Hope this helps
Please mark as answered if this answer helped you.
Im not Understanding but May be Im wrong. you want the Search result of another website and you want to display these results on your web form... its Interesting but i didnt do that so far and didnt think.. for it
as the 2nd Post is about Screen Scrapping so try this
i want the Search result of another website and you want to display these results on my web form...
i have one form like transport information, in that form i have 3 textbox, in 1st textbox i put trichy in 2nd textbox i put chennai in 3rd textbox enter date and give search means the search want to search in this http://www.ticketgoose.com/
website and give me result in my form gridview how will i do this ?
i want the Search result of another website and want to display these results on my web form...
Guide me pls... screen scraping or WCF or iframe ot GET POST method which is i want to use in my this project i am so much confusion pls guide me more... pls...
http://www.ticketgoose.com/bookbustickets/TravelBkgSearchAction.do is sending search queries through session using, i think, java. So it will not be possible to get search result
from that page unless you can programmatically fill in the form & subject the search button, get the session query string.
If you still want to try, please try to use browser control of .net, open the page, parse the page info, fill the form, submit, get result & then use screen scraping / html parsing to get the page content.
Please mark as answered if this answer helped you.
maddyrafi897...
Member
134 Points
300 Posts
Fetch From Database
Apr 30, 2012 10:42 AM|LINK
how to fetch data from other website in asp.net, i mean the search result is in one website then how to bring that search result to my form ?
AidyF
Star
9204 Points
1570 Posts
Re: Fetch From Database
Apr 30, 2012 10:46 AM|LINK
You need to use a technique called "screen scraping". Get the html from the results page using the code here
http://msdn.microsoft.com/en-us/library/system.net.webrequest.aspx
You will then need to parse that html to get the data you want. Depending on how you do this, if the target site changes their html then you will need to re-code your site too.
maddyrafi897...
Member
134 Points
300 Posts
Re: Fetch From Database
Apr 30, 2012 10:49 AM|LINK
Pls tel me step by step procedure i cnt understand ? i am new to dotnet and screen scraping... pls provide more details... and send me the procedure pls...
Shankar_ss
Participant
1270 Points
279 Posts
Re: Fetch From Database
Apr 30, 2012 10:50 AM|LINK
?
If you are not owning both the websites, then getting search results will not be possible.
Say if there are 2 sites a.com and b.com:
1. If you own both the sites, then use Iframe in your website to display the search result.
2. You can also use http GET & POST method to transact between the two sites.
If you want to get data from a.com into b.com but you only own (manage) b.com, then you cannot get search results. But you can get content from that page by doing html parsing of the page.
Hope this helps
Shankar
MahadPK
Participant
778 Points
225 Posts
Re: Fetch From Database
Apr 30, 2012 10:51 AM|LINK
Im not Understanding but May be Im wrong. you want the Search result of another website and you want to display these results on your web form... its Interesting but i didnt do that so far and didnt think.. for it
as the 2nd Post is about Screen Scrapping so try this
http://www.codeproject.com/Articles/1915/Screen-Scraping-with-C-for-ASP-NET
And Rafi you may you Google Search result and Iframe may be this can help.
maddyrafi897...
Member
134 Points
300 Posts
Re: Fetch From Database
Apr 30, 2012 11:18 AM|LINK
i want the Search result of another website and you want to display these results on my web form...
i have one form like transport information, in that form i have 3 textbox, in 1st textbox i put trichy in 2nd textbox i put chennai in 3rd textbox enter date and give search means the search want to search in this http://www.ticketgoose.com/ website and give me result in my form gridview how will i do this ?
i want the Search result of another website and want to display these results on my web form...
Guide me pls... screen scraping or WCF or iframe ot GET POST method which is i want to use in my this project i am so much confusion pls guide me more... pls...
Shankar_ss
Participant
1270 Points
279 Posts
Re: Fetch From Database
Apr 30, 2012 12:01 PM|LINK
http://www.ticketgoose.com/bookbustickets/TravelBkgSearchAction.do is sending search queries through session using, i think, java. So it will not be possible to get search result from that page unless you can programmatically fill in the form & subject the search button, get the session query string.
If you still want to try, please try to use browser control of .net, open the page, parse the page info, fill the form, submit, get result & then use screen scraping / html parsing to get the page content.
Shankar
maddyrafi897...
Member
134 Points
300 Posts
Re: Fetch From Database
Apr 30, 2012 12:12 PM|LINK
pls tel me step procedure, now what wil i do ?
open 1 web from and fill the form here its done here, and after how to write that coding in search button ? what i want to write in search button ?
YunJiang
Participant
1124 Points
122 Posts
Re: Fetch From Database
May 06, 2012 01:43 PM|LINK
You can retrieve data from a web page by the HttpWebRequest and httpWebResponse classes.
please read the following sample:
http://aspnetlibrary.com/articledetails.aspx?article=Retrieve-data-from-a-web-page
http://www.dotnetspider.com/resources/36283-Fetch-data-from-other-website.aspx
maddyrafi897...
Member
134 Points
300 Posts
Re: Fetch From Database
May 07, 2012 04:36 AM|LINK
using that link code how will i write code in which event ? i nthat link have getpost and response ? how to write that code in my page ?