简体   繁体   中英

Finding specific names on a website using Python

I need to make an app that uses Python to search for specific names on a website. For instance, I have to check if the string "Robert Paulson" is being used on a website. If it is, it returns True. Else, false. Also,is there any library that can help me make that?

Since you have not attempted to make your application first, then I am not going to post code for you. I will however, suggest using:

urllib2: A robust module for interacting with webpages. ie pull back the html of a webpage.

BeautifulSoup (from bs4 import BeautifulSoup): An awesome module to "regex" html to find what is is that you're looking for.

Good luck my friend!

You could do something similar to this other answer . You will just need the regex to find your string.

I have also used Selenium webdriver to solve some more complex webesite searching, although I think the link I provided would solve your problem more simply.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM