A handy tool for scraping Tianyancha.
-
PhantomJS / Chromedriver
-
Selenium
-
BeautifulSoup
-
TKinter
-
Reading from a user specified txt file as input (UTF-8).
-
Generate corresponding search link.
-
Browse each link on Tianyancha using Selenium and PhantomJS/Chromedriver.
-
Parse the search page and decide if there are valid return result. Open the first result link to enter company info page.
-
Use BeautifulSoup to parse the html page and extract POIs and store them.
-
Display the current parsed result on the GUI, and record search result in output files. (Producer-Consumer Model)
-
Providing a one-click function for post-processing / duplicate removal, and return *.csv file for user to further analyze in Excel.
-
User can abort and restart the scraper at any time. Three threads:
- Main thread: GUI based on TKinter.
- Scraper thread: Perform search and extraction.
- Monitor thread: Keep track of Scraper thread and display most recent search results to GUI.
python setup.py py2exe
