Jump to content
UBot Underground

[Solved]Scraping the First Number in a String


Recommended Posts

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

Link to post
Share on other sites

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,34

10 minute trainer dvd,17

10 minute trainer tony horton,27

10 minute trainer workout,10

100 visalus shake recipes,156

 

Any idea why those quotes and the extra line break is in there?

 

Thanks

Link to post
Share on other sites

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 body

10 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

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...