Jul-06-2020, 08:45 PM
Any ideas on how to put the printed results in a CSV, JSON, or Excel format/file?
import requests
from parsel import Selector
#GET request from the website
response = requests.get('https://www.youtube.com/')
selector = Selector(response.text)
hreflinks = selector.xpath('//a/@href').getall()
imagelinks = selector.xpath('//img/@src').getall()
print(hreflinks)
print(imagelinks)
