What do you want to save?
Add Code snippet
New code examples
-
Python 2021-09-29 02:54:02
how to get text from a website python
import requests from bs4 import BeautifulSoup #pip install bs4 url = 'https://www.troyhunt.com/the-773-million-record-collection-1-data-reach/' res = requests.get(url) html_page = res.content soup = BeautifulSoup(html_page, 'html.parser') text = soup.fi... Add solution -
Python 2021-09-18 18:06:03
get table wikipedia
import requests from bs4 import BeautifulSoup URL = "https://en.wikipedia.org/wiki/List_of_current_heads_of_state_and_government" res = requests.get(URL).text soup = BeautifulSoup(res,'lxml') for items in soup.find('table', class_='wikitable')... Add solution -
Python 2021-09-16 15:57:03
python beautifulsoup get attibute
xmlData = None with open('conf//test1.xml', 'r') as xmlFile: xmlData = xmlFile.read() xmlDecoded = xmlData xmlSoup = BeautifulSoup(xmlData, 'html.parser') repElemList = xmlSoup.find_all('repeatingelement') for repElem in repElemList: print(&q... Add solution -
Html 2021-09-06 04:59:01
scrape beautifulsoup python html attribute value
xmlData = None with open('conf//test1.xml', 'r') as xmlFile: xmlData = xmlFile.read() xmlDecoded = xmlData xmlSoup = BeautifulSoup(xmlData, 'html.parser') repElemList = xmlSoup.find_all('repeatingelement') for repElem in repElemList: print(&q... Add solution -
Python 2021-08-29 23:17:02
how to find pdf file in link beautifulsoup
# Find links to pdf files in HTML with BeautifulSoup import urllib2 from bs4 import BeautifulSoup my_url = 'http://slav0nic.org.ua/static/books/python/' html=urllib2.urlopen(my_url).read() sopa = BeautifulSoup(html) current_link = '' for link in sopa.fin... Add solution