| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| DNOA Member Join Date: May 2004
Posts: 5,040
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | |
| |
| | #2 (permalink) |
| NamePros Regular Join Date: Aug 2005
Posts: 315
![]() | Can I ask why your screen scraping is not working anymore? I have my own screen scraper script in asp that is working just fine by reading the actual alexa page and getting the values. They have comment code just before the numbers you have to read, just look for that. http://seohelp.info/alexarankings.asp I haven't extensively tested this script with many domains, so I don't know if they all work, but from what I can tell its still possible to get the data.
__________________ |
| |
| | THREAD STARTER #3 (permalink) |
| DNOA Member Join Date: May 2004
Posts: 5,040
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Look at the source code, they've placed strange tags between the digits of the rankings. I always used to get the rankings properly but now when I go and try it, they come up "0" and I haven't changed anything. |
| |
| | #4 (permalink) |
| NamePros Regular Join Date: Aug 2005
Posts: 315
![]() | Heh I never noticed this change, my code seams to have been immune to their code change. My page puts all those useless code parts in my page too, but since they do nothing they dont display. I grab all the data between The TD tags. I do a search on the page for "Alexa Web Information Service.-->" When found, I grab everything between the following TD tags, which inclues all the useless code. Since the useless code doesnt display in a browser, It just displays the numbers.
__________________ |
| |
| | THREAD STARTER #5 (permalink) |
| DNOA Member Join Date: May 2004
Posts: 5,040
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Ah... maybe I should remove the number formatting functions (custom ones, I guess I'll live w/o them)... I don't want excess code in the source either but I guess these random tags won't matter... Well, thanks, I'll see what happens tomorrow when I work on it. |
| |
| | #6 (permalink) |
| NamePros Regular Join Date: Aug 2005
Posts: 315
![]() | With this now brought to my attention I think by just converting the text gathered and converting it to numeric only values may eliminate the extra code. I will test that later and see if I can rid myself of the crazy code. Or just code in a remove all tags function to remove any and all tags from the retrieved data between the TD tags. Should not be hard, its just looking for "<" and ">" in the extracted text and removing all text in between.
__________________ |
| |
| | THREAD STARTER #7 (permalink) |
| DNOA Member Join Date: May 2004
Posts: 5,040
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Yeah, that's hard, but there's numbers inside the < and > characters... but yeah I should try a strip_tags function and see if that helps: But they aren't standard HTML tags... hmm.. I'll figure this out sooner or later |
| |
| | #8 (permalink) |
| NamePros Regular Join Date: Aug 2005
Posts: 315
![]() | Gota think outside the box. ![]() You are thinking of looking for the tags specificaly. This is not how to make a strip tags function. First you look for a "<" then find the next time you see ">" and delete, then do it again, until you dont find anymore "<" All the weird tags start with a "<" and end with a ">" so if you know you dont want anything in between these two things its fairly easy to remove the elements in a small loop. ????: NamePros.com http://www.namepros.com/programming/163938-retrieving-alexa-ranking-programmatically.html I dont know PHP but in asp this is easy as I just grab the info between the TD tags, put it in a temp variable, then remove all tags function that returns the value without any tags.
__________________ |
| |
| | #10 (permalink) |
| NamePros Regular Join Date: Jan 2005 Location: Land of the m00
Posts: 729
![]() ![]() ![]() ![]() | Just fetch the number like mentioned above, with all the mumbojumbo tags included. Then just use strip_tags($string_with_mumbojumbo_tags) to clean it up. I guess you've already found out a way to fix this, but I just wanted to put up a solution at the end of the thread if someone, like I just did, tries to find the answer here in the forum
__________________ The more I think the more confused I get... |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Deleted Domain List Site FREE | dropscripts | For Sale / Advertising Board | 12 | 09-24-2003 08:16 AM |