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