Vielen Dank im Voraus!
Hier ist der Code:
Code: Select all
import urllib.request
from bs4 import *
htmlfile = urllib.request.urlopen("http://www.theworldcounts.com/counters/shocking_environmental_facts_and_statistics/world_population_clock_live")
htmltext = htmlfile.read()
soup = BeautifulSoup(htmltext)
body = soup.find(text="World population").find_previous('p')
print (body.text)
Mobile version