What do you want to save?
Add Code snippet
New code examples
-
Python 2021-11-18 16:43:13
export html table to csv python
# Importing the required modules import os import sys import pandas as pd from bs4 import BeautifulSoup path = 'html.html' # empty list data = [] # for getting the header from # the HTML file list_header = [] soup = BeautifulSoup(op... Add solution -
Python 2021-11-06 20:08:24
iterate over meta tag python
import urllib.request from bs4 import BeautifulSoup f = open('out.txt','w') url = "http://www.international.gc.ca/about-a_propos/atip-aiprp/reports-rapports/2012/02-atip_aiprp.aspx" page = urllib.request.urlopen(url) soup = BeautifulSoup(page... Add solution -
Python 2021-10-24 10:07:08
change xlabel python
import matplotlib.pyplot as plt fig, ax = plt.subplots() # We need to draw the canvas, otherwise the labels won't be positioned and # won't have values yet. fig.canvas.draw() labels = [item.get_text() for item in ax.get_xticklabels()] labels[1] = 'Tes... Add solution -
Other 2021-09-27 21:11:03
reading doc in python
from bs4 import BeautifulSoup as bs soup = bs(open(filename).read()) [s.extract() for s in soup(['style', 'script'])] tmpText = soup.get_text() text = "".join("".join(tmpText.split('\t')).split('\n')).encode('utf-8').strip() print text Add solution -
Python 2021-09-26 01:33:04
matplotlib get and chan values of tick labels
import matplotlib.pyplot as plt fig, ax = plt.subplots() # We need to draw the canvas, otherwise the labels won't be positioned and # won't have values yet. fig.canvas.draw() labels = [item.get_text() for item in ax.get_xticklabels()] labels[1] = 'Tes... Add solution -
Other 2021-08-30 05:19:02
soup itemprop
birthday = soup.find(itemprop = 'birthDate').get_text() age = soup.find('span', class_ = 'item birthday').find('strong').get_text() locality = soup.find(itemprop = "addressLocality").get_text() nationality = soup.find(itemprop = "nationalit... Add solution
Best helpers
Gaussler
+5
Annu_tiger
+5
Des Wilson
+5
Twbrown
+5
Dreeves
+5
Xoxocrow
+5
Arash.amd
+5
Bread
+5
Xzhu
+5
Steven Choi
+5
AndrewBC
+5
Static
+5
C. Starr
+5