xxxxxxxxxx
import requests
from bs4 import BeautifulSoup
url = 'YOUR_WEBSITE_URL_HERE'
response = requests.get(url)
soup = BeautifulSoup(response.content, 'html.parser')
# Extract the elements you need from the website using BeautifulSoup
# For example, to extract all the links on the page:
for link in soup.find_all('a'):
print(link.get('href'))
# You can customize this code to scrape specific elements or data from the JavaScript website.
xxxxxxxxxx
import os
import requests
from bs4 import BeautifulSoup
url = "https://www.google.com/"
reponse = requests.get(url)
if reponse.ok:
soup = BeautifulSoup(reponse.text, "lxml")
title = str(soup.find("title"))
title = title.replace("<title>", "")
title = title.replace("</title>", "")
print("The title is : " + str(title))
os.system("pause")