rohanbk / mountain-project-scraper Goto Github PK
View Code? Open in Web Editor NEWPython scrapy-based repository for mining information associated with MountainProject
Python scrapy-based repository for mining information associated with MountainProject
This is for future work, but it will help solve some interesting data-science ideas.
Each area-page has knowledge of their parents (i.e. breadcrumbs) and children (e.g. the list of all sub-areas in the links side-menu). Capture this information using the ID of each area.
domain = 'https://www.mountainproject.com'
# URL should be preceded by a /
# e.g. /destinations or /v/STATENAME/ID
relativeURL = '/v/hawaii/106316122'
start_urls = [domain + relativeURL]
allowed_domains = ['mountainproject.com']
rules = [
Rule(
LinkExtractor(allow='v/(.+)'),
callback='parse',
follow=True
)
]
The /v/ URLs redirect to a new scheme:
2023-01-15 11:19:22 [scrapy.downloadermiddlewares.redirect] DEBUG: Redirecting (301) to <GET https://www.mountainproject.com/viewer-old/106316122> from <GET https://www.mountainproject.com/v/hawaii/106316122>
2023-01-15 11:19:22 [scrapy.downloadermiddlewares.redirect] DEBUG: Redirecting (302) to <GET https://www.mountainproject.com/area/106316122/hawaii> from <GET https://www.mountainproject.com/viewer-old/106316122>
if self.relativeURL != '/destinations':
# use the following links variable if testing from an individual state page (e.g. WA states routes)
links = response.css('#viewerLeftNavColContent a[target="_top"] ::attr(href)').extract()
<div id="viewerLeftNavColContent" class="rspCollapsedContent">
was present in old pages: https://web.archive.org/web/20161122233413/http://www.mountainproject.com/v/alabama/105905173
but no longer.
else:
# use the following links variable if testing from the homepage
links = response.css('span.destArea a::attr(href)').extract()
<span class="destArea">
was present on old homepage:
https://web.archive.org/web/20171016232313/https://www.mountainproject.com/
but no longer.
All Mountain Project entities (e.g. states, larger geographical areas, micro-zones, routes, boulder problems, etc.). have a unique URL ID associated with them. This ID should be captured in each Scraped entry.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.