Question
Write a simple python program to crawl 10 pages from the web and store the text content in the pages into csv file. You code,
Write a simple python program to crawl 10 pages from the web and store the text content in the pages into csv file. You code, the 10 html pages, and the csv file which store the content in the pages should be submitted.
Tips: you can write your own program by referencing this tutorial: https://codeburst.io/scraper-b82146396249
Tips2:
(1) If you use python2 on your computer, you can use the following code to get web pages:
import urllib2
page = urllib2.urlopen('https://www.pythonforbeginners.com/')
print page.info() print page.read()
(2) If you use python3 on your computer, you can use the following code to get web pages:
import urllib.request page = urllib.request.urlopen('https://www.pythonforbeginners.com/')
print (page.info()) print (page.read())
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started