Skip to main content

Web scrapers for various innovation opportunity sites

Project description

opportunity_scraper

opportunity_scraper is a Python3 script for scraping R&D competition websites and dumping the results into the SuiteCRM V8 API.

Installation

Install with pip:

pip3 install opportunity_scraper

Dependencies

opportunity_scraper uses chromedriver, and will not work without it. Download the appropriate chromedriver version for your Chrome or Chromium version.

Supported resources

Usage

SuiteCRM OAuth2 credentials

Before using the scraper, you need to create some SuiteCRM OAuth2 credentials for the script to use.

  • Navigate to the OAuth2 Clients and Tokens admin page (https://www.your-suitecrm-instance.com/suitecrm/index.php?module=OAuth2Clients)
  • Create a new Client Credentials Client

The client ID and secret will be used in configuration.

Configuration

Configuration is via a YAML file.

The default location is ~/.config/opportunity_scraper/settings.yaml, but this can be changed with the --config CLI option at runtime.

The following can be used as a template for the config file. All values are required.

browser:
    # Location of chromedriver
    chromedriver: "/usr/bin/chromedriver"
    # Credentials for KTN Innovation Exchange
    ktn_username: "dummy@example.com"
    ktn_password: "somesecretpassword"

oauth:
    # SuiteCRM OAuth2 credentials
    token_url: "https://example.com/suitecrm/Api/access_token"
    client_id: "some-uuid-token"
    client_secret: "anotherpassword"

suitecrm:
    # SuiteCRM API
    api_url: "https://example.com/suitecrm/Api"
    # Account name / ID for .gov.uk competitions
    govuk_account_name: "Opportunity Account Name"
    govuk_account_id: "another-uuid"
    # Account name / ID for KTN competitions
    ktn_account_name: "Opportunity Account Name"
    ktn_account_id: "another-uuid"
    # Default user to be assigned new opportunities
    assigned_user_name: "admin"
    assigned_user_id: "1"

Running

usage: opportunity_scraper [-h] [-c CONFIG]

Scrape R&D competitions and push the results to the SuiteCRM API.

optional arguments:
  -h, --help            show this help message and exit
  -c CONFIG, --config CONFIG
                        Location of config file

License

GPLv3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opportunity_scraper-0.1.5.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opportunity_scraper-0.1.5-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file opportunity_scraper-0.1.5.tar.gz.

File metadata

  • Download URL: opportunity_scraper-0.1.5.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for opportunity_scraper-0.1.5.tar.gz
Algorithm Hash digest
SHA256 2bfa78b9fa65f9d00a2a146c3db9961e4b481fae1a08a0cc48b2b061775d7f87
MD5 2fcbd426ff4c45ca9595fe6b3cfd1b55
BLAKE2b-256 9a476ebefbc702ce59a4f66875c05a648672a62450f99a69693f2a4cc4b6e9ea

See more details on using hashes here.

File details

Details for the file opportunity_scraper-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: opportunity_scraper-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 20.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for opportunity_scraper-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 85438b189b6473f7680340b847f7b333538c9ea891c08beab503d54dbe667a9e
MD5 f950bfaea651a05301ce69f9430c7b96
BLAKE2b-256 8abcabe45bca0d14922e28249bb589bccd45bcc58cbafab606f21dca920d3c29

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page