Day 71 Of 100DaysOfCode: Web Scraping
Durga Pokharel
Posted on March 9, 2021
This is my 71th day of #100daysofcode and #python learning. Like daily today also learned from Datacamp regarding to the topic web scraping. Today I learned about simple xpath, slasher double feature, (At)tribute, content with contains, extracting data from a selector list, inspecting the HTML.
Here is python code to extract data from selector list.
Python code
# Import a scrapy Selector
from scrapy import Selector
# Import requests
import requests
# Create the string html containing the HTML source
html = requests.get( url ).content
# Create the Selector object sel from html
sel = Selector( text = html )
# Print out the number of elements in the HTML document
print( "There are 1020 elements in the HTML document.")
print( "You have found: ", len( sel.xpath('//*') ) )
Day 71 Of #100DaysOfCode and #Python
— Durga Pokharel (@mathdurga) March 9, 2021
Web-Scraping From https://t.co/6UM9B22c7fDatacamp#womenintech #100DaysOfCode #CodeNewbie #WomenWhoCode #DEVCommunity pic.twitter.com/A5vd6ID1mE
💖 💪 🙅 🚩
Durga Pokharel
Posted on March 9, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.