Comments (4)
Does it make sense to change the links now since the pages will ultimately be updated with new information? Or should we link to a particular snapshot in time using the Wayback Machine, for example: https://web.archive.org/web/20170715183551/http://www.ontla.on.ca/web/members/members_current.do?locale=en
from lc-webscraping.
I think it would be worth updating the link to the wayback version, because it future proofs against both dissolving of the parliament, and website changes. In fact it's probably a great example of one of the perils of web scraping in that your can code break if the website updates!
from lc-webscraping.
Actually I just tried to scrape the IA page with scrapy and received a "Forbidden by robots.txt" error. Currently it is set to deny all user agents bar the ia_archiver. I guess this might require someone from LC contacting IA to gain permission for scraping for training purposes?
from lc-webscraping.
I've hit similar issues in episode 3 (PR https://github.com/LibraryCarpentry/lc-webscraping/pull/29).
Another issue with Internet Archive snapshots is that an extra <div>
is injected, that changes page structure and often the XPath generated by the Scraper browser plugin. The workaround for this is to use the id_
variant of the IA URL which gives the original unmodified page (eg, http://webarchive.parliament.uk/20150218214039/http://www.parliament.uk/mps-lords-and-offices/mps/ vs. http://webarchive.parliament.uk/20150218214039id_/http://www.parliament.uk/mps-lords-and-offices/mps/ ). Unfortunately this results in broken links to CSS and images, making the page look broken - the content can still be reliably scraped using Scraper.
With regard to robots.txt
- Scrapy can be configure to ignore this (https://www.simplified.guide/scrapy/ignore-robots), but it could be a controversial workaround with regard to the ethics of web scraping.
I think we do need to use stable snapshots of pages hosted somewhere - it may be that the Internet Archive isn't the solution to that however.
from lc-webscraping.
Related Issues (20)
- Lesson content
- Ethics of webscraping
- Legislative Assembly of Ontario Page Structure changes
- This is very different from the data-lessons version HOT 1
- Error in walk-through of "select the challenge box" solution HOT 2
- Rework of lesson available for mining into the original HOT 3
- June 2019 Lesson Release checklist HOT 1
- Tom Scott video on scraping HOT 2
- update link suggestion for case study Ep5 conclusion HOT 2
- Changes to UK Members of Parliament HOT 1
- Scraper extension icon gives error HOT 2
- Scraper export to Google Drive disabled HOT 2
- Dead link to XPath Cheatsheet in Ep2
- Using Bash
- Lesson Maintainer Recruitment
- Need jump lists (anchors) for headings
- Low-priority: Update lesson title in LC lesson directory
- Deal with content from Additions heading in episode 02
- Adjust lesson or links so directions match content in Episode 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lc-webscraping.