orbital 15 Posted July 3, 2012 Report Share Posted July 3, 2012 I wanting to scrape the number of results for a keyword from ebay. Here is an example page from ebay. I am wanting to get the number of results for the search term. The thing I'm running into is sometimes ebay sends a certain class for the results and sometimes it doesn't, like the example above. So in order for me to make sure I am getting the results of the search term all the time I need to figure something else out that is more reliable since ebay will sometimes change the results page. Here is an example of an ebay page with the defined class for the search results.Just in case there is any confusion in what number I am after here is a screenshot.http://screencast.com/t/AiIz8SJx6WF1thanks for any and all help Quote Link to post Share on other sites
orbital 15 Posted July 5, 2012 Author Report Share Posted July 5, 2012 Thank you willwonka for the help on this. I do have a question about the code. for some reason, when the value is scraped it is scraping a line break as well so I get a result like this in my final output: 10 minute trainer,"34" 10 minute trainer dvd,"17" 10 minute trainer tony horton,"27" 10 minute trainer workout,"10" 100 visalus shake recipes,"156" were I wanted to have results like this: 10 minute trainer,3410 minute trainer dvd,1710 minute trainer tony horton,2710 minute trainer workout,10100 visalus shake recipes,156 Any idea why those quotes and the extra line break is in there? Thanks Quote Link to post Share on other sites
orbital 15 Posted July 5, 2012 Author Report Share Posted July 5, 2012 thank you willywonka, your help is seriously helping me understand this better. I am running into an issue on my end with keywords that only return 1 result when searched for in ebay. here are two keywords that are returning one result on my end. I live in the united states 10 minute trainer upper body10 minute trainer by tony horton according to the debugger it isn't scraping this result and it seems to only happen when there is 1 result. thanks again for the help Quote Link to post Share on other sites
orbital 15 Posted July 5, 2012 Author Report Share Posted July 5, 2012 Thanks so much willywonka it is working great! I never even thought about putting all that stuff inside a $trim function. that is great stuff. Thanks again I'm running over 6 thousand keywords through it right now and will check it in the morning and report with how things went. Quote Link to post Share on other sites
orbital 15 Posted July 5, 2012 Author Report Share Posted July 5, 2012 Glad it worked. I work a lot with ebay. For the last 3 year most of my income has come selling there. If you don't mind I would like to know what you are doing there . If you don't want to discus it openly you can PM me. Sure thing, I don't mind discussing it. I am checking a huge list of keywords to see what keywords in the list are relevant to ebay. So if the keyword has greater than 5 results I want to know that so I can build a post around that keyword with phpbay. I make most of my income as an ebay affiliate. Pretty much build lots and lots of sites and drive traffic to ebay. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.