0% found this document useful (0 votes)
245 views1 page

Assignment 71

The document provides instructions to download all videos from a YouTube playlist using the PyTube library and save them to a specific folder. It also provides instructions to scrape member data and links from a congressional website, save the HTML source to a file, and extract various fields like names, years, positions, parties, states, and congress details into a CSV file.

Uploaded by

deepakkashya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
245 views1 page

Assignment 71

The document provides instructions to download all videos from a YouTube playlist using the PyTube library and save them to a specific folder. It also provides instructions to scrape member data and links from a congressional website, save the HTML source to a file, and extract various fields like names, years, positions, parties, states, and congress details into a CSV file.

Uploaded by

deepakkashya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

2. Write a program to download all the videos from youtube.

com for django from


the hyperlink given below
https://www.youtube.com/playlist?list=PLxxA5z-8B2xk4szCgFmgonNcCboyNneMD

from pytube import YouTube###YouTube('https://www.youtube.com/watch?


v=dxZOyl33700&list=PLWPirh4EWFpEFSYTbKaST6hSlgIFCJjU3&index=15').streams.first().do
wnload("F:/Usman")

from 3 to 5

3. Create a csv file with name and hyperlink after fetching it from the web page
http://bioguide.congress.gov/biosearch/biosearch1.asp
download the page source and save in html file and then perform scrapping
4. from the question above, fetch only the hyperlinks
5. from the question above, fetch - names, years, positions, parties, states,
congress,
fullLink

import requests
from bs4 import BeautifulSoup

r=requests.get("http://bioguide.congress.gov/biosearch/biosearch1.asp")

c=r.content
soup=BeautifulSoup(c,"html.parser")
for link in soup.find_all('name, years'):
print(link.get('href'))

print(c)

You might also like