HUB
Sign inSign up
sitemap-scraper logo

projectassistant/sitemap-scraper

By projectassistant

•Updated over 5 years ago

Includes beautifulsoup, requests, selenium, pathlib, lxml

Image
0

739

projectassistant/sitemap-scraper repository overview

⁠Site Map Checker

This python script scans https://www.certara.com/sitemap_index.xml⁠,

⁠Config File

The config.json file in the root directory.

Site Map ThreadPoolExecutor Add/Subtract max_workers for Site Map ThreadPoolExecutor by updating the site_map_workers attribute of the json file.

"site_map_workers": 1,

URL ThreadPoolExecutor Add/Subtract max_workers for URL ThreadPoolExecutor by updating the link_workers attribute.

"link_workers": 20,

Manage Sitemaps Add/Remove sitemaps crawled on https://www.certara.com/sitemap_index.xml⁠ in the site_maps attribute.

 "site_maps":[
"https://www.certara.com/post-sitemap1.xml",
"https://www.certara.com/post-sitemap2.xml",
"https://www.certara.com/post-sitemap3.xml",
"https://www.certara.com/page-sitemap.xml",
"https://www.certara.com/post_tag-sitemap.xml",
"https://www.certara.com/publications-sitemap.xml"
],

Exclude URLs from being crawled

Add/Remove paths for the scraper to ignore by updating the ignore_paths attribute of the json file.

  "ignore_paths": [
    "/brochure/",
    "/case-study/",
    "/white-paper/",
    "/poster/",
    "/wp/wp-admin/",
    "/wp/wp-includes/js/jquery/jquery.js",
    "/27554-2/",
    "/4a-decision-framework/",
    "/why-phoenix-nlme-is-the-best-in-class-solution-for-pop-pkpd/",
    "/payment/"
  ],

⁠Setup

  1. Fork/Clone
  2. Update config file if necessary
  3. Install the requirements
  4. Run the scraper:
    python main.py
    

From https://github.com/testdrivenio/concurrent-web-scraping⁠

⁠Docker

⁠Compose

⁠Docker Run

docker run -v CHANGE_TO_LOCAL_DIRECTORY:/usr/src/scraper -it projectassistant/sitemap-scraper:chromedriver /bin/bash
cd /usr/src/app
python main.py
Tag summary
Recent tags
Content type
Image
Digest
Size
545 MB
Last updated
over 5 years ago
docker pull projectassistant/sitemap-scraper:latest