Look for cities on website via /r/learnprogramming


Look for cities on website

I'm trying to figure out the most optimal way to search a webpage (news articles mostly) for all and any cities mentioned (only in United States). I can't think of anything other than making the whole HTML source into a giant string using Beautiful Soup, and then searching for the name of every city in the state (I know for each of these which state's cities I am looking for). Just wondering if there is a faster or more efficient way to do this, as I assume this would take a long time to run. Using Python if that helps at all.

Submitted July 10, 2017 at 01:57PM by Polkadottedzan
via reddit http://ift.tt/2u0YDbj

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s