I have no experience with python, BeautifulSoup, Selenium etc. but I\'m eager to scrape data from a website and store as a csv file. A single sample of data I need is coded
So it seemed quite nice:
# -*- coding: utf-8 -*-
# by Faguiro #
# run using Python 3.8.6 on Linux#
import requests
from bs4 import BeautifulSoup
# insert your site here
url= input("Enter the url-->")
#use requests
r = requests.get(url)
content = r.content
#soup!
soup = BeautifulSoup(content, "html.parser")
#find all tag in the soup.
heading = soup.find_all("h3")
#print(heading) <--- result...
#...ptonic organization!
n=len(heading)
for x in range(n):
print(str.strip(heading[x].text))
Dependencies: On terminal (linux):
sudo apt-get install python3-bs4