![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | |
|
Hobbyist Programmer
Join Date: Sep 2005
Location: A House...
Posts: 191
Rep Power: 4
![]() |
Screen Scraping
Hi,
I have a question about screen scraping and Regular Expressions. There is a website, and of the source code, I want to get this line PLAYERS:<b><br><font color="#ea0437"><b>Be Text Here</b></font><br><font color="#ea0437"><b>Be Text Here</b></font><br><font color="#ea0437"><b>Be Text Here</b></font><br><br><font color="#1796cb"><b>Be Text Here</b></font><br><font color="#1796cb"><b>Be Text Here</b></font><br> Then after i get that line i want to go further and get all the text where the Quote:
|
|
|
|
|
|
|
#2 |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4
![]() |
If the source code is XHTML compliant, use the nifty features of the XML namespace. Load it as an XML document and use XPath to select the nodes you want.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270 |
|
|
|
|
|
#3 | ||
|
Hobbyist Programmer
Join Date: Sep 2005
Location: A House...
Posts: 191
Rep Power: 4
![]() |
English please? Lol, serioulsy
Quote:
Quote:
*Goes to look on MSDN* -T |
||
|
|
|
|
|
#4 |
|
Hobbyist Programmer
|
The source doesn't look XHTML compliant so it looks like you are just going to have to hope the html code never changes. After you get the first line that you want, you will probably have to parse that line based on the second bold tag you come across. This is why screen scraping is not recommended, but sometimes there is no other choice. If someone takes the bold tags out then your code will not work correctly anymore. Just a chance you gotta take.
|
|
|
|
|
|
#5 |
|
Expert Programmer
|
That is one of the great things about writing screen scrapers, putting terms in the contract which make you more money when the web source does change
Of course, this is when you are writing the code for someone else, who is much less programming savy
__________________
Clifford Matthew Roche <geek@cliffordroche.com> Web Hosting: http://www.crd-hosting.com Consulting: http://www.crdev-consulting.com |
|
|
|
|
|
#6 |
|
Hobbyist Programmer
|
Hmmm I never thought about it like that
![]() |
|
|
|
|
|
#7 |
|
Newbie
Join Date: Feb 2006
Posts: 1
Rep Power: 0
![]() |
hello everyone, Can anyone help me... I am right now working on a project to create a Microsoft Outlook 2003 Addin... Tell me how to integrate a stand alone application in to Microsoft Outlook 2003
|
|
|
|
|
|
#8 |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4
![]() |
1. Read the posting guidelines
2. Make your own thread. Hijacking is bad. 3. ??? 4. Success!
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270 |
|
|
|
|
|
#9 | |
|
Newbie
|
Quote:
![]() |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|