Jump to content
UBot Underground

Scraping Wikipedia + Conditional Statement


Recommended Posts

I'm trying to scrape wikipedia & am getting hung up under certain conditions. Take these two search terms:

 

- Menudo

 

- Ricky Martin

 

If you search for Menudo, you come to an intermediary page that lists different options. Searching under Ricky Martin brings you directly to the artist's page. I want to be able to evaluate the intermediary page and click through to the final destination.

 

I have the issue partly solved:

 

I write a conditional statement that searches for "This disambiguation page..." text on the page. But now I need to click the FIRST (#1) bullet point on the page to bring me to the correct URL. But I haven't been able to figure out a way to code this...

Link to post
Share on other sites

Attached is the bot to help out.

 

This one is done from this page but test multiple ones and it works.

 

http://en.wikipedia.org/wiki/Hamlet_(disambiguation)

 

Im assuming you will have the search keyword saved and you need to use that where the variable keyword is.

groneg.ubot

  • Like 2
Link to post
Share on other sites

Attached is the bot to help out.

 

This one is done from this page but test multiple ones and it works.

 

http://en.wikipedia.org/wiki/Hamlet_(disambiguation)

 

Im assuming you will have the search keyword saved and you need to use that where the variable keyword is.

 

I gotcha. The example is perfect. Thank you Very Much!

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...