/Python-Scraper

Python regular expressions for scraping phone numbers and email addresses

Primary LanguagePythonMIT LicenseMIT

Python-Scraper

Python regular expressions for scraping phone numbers and email addresses

Description

With this program, you can copy only the phone number and email adrresses from the document you need. You do not have to download the document or anything like it, just press 'control + a' to select everything from the file and run the code to scrap all the phone numbers and email addresses found.

Installation

Make sure you have installed Python 3 in your machine and import the pyperclip module, the latter will be necessary to import your selection for scraping. The pyperclip module can be installed as follows:

  • open the Command Prompt (cmd)
  • type 'pip install pyperclip'
  • check if the pyperclip module has been successfully installed

If you have problems installing the pyperclip module, please visit the link to pyperclip.

Usage

  1. Open the document that you need to import the phone numbers and email addresses.
  2. Press 'control + a', or select the part which is necessary for you.
  3. Run the program, via .py, IDLE or cmd.
  4. You can see the scraped phone numbers and email addresses on your screen.
  5. All those phone numbers and email addresses were also copied to your clipboard. Paste it to see those results.

Note

I wrote the code in Windows. Therefore, the shebang line (first line of the code) tells my computer run Python 3 in my operating system Windows. If you use another OS, Linux or OS X, please change that first line to the one which fits you. Please visit Automate the Boring Stuff with Python Programming for further explanation.