Ich versuche, den Text in der td-Klasse 'Spalte-1' zu bekommen, und ich habe einige Probleme, weil es keinen Attributtext hat - aber es tut eindeutig so muss ich etwas falsch machen. Hier ist der Code:python beautifulsoup findall innerhalb finden
import urllib
import urllib.request
from bs4 import BeautifulSoup
theurl="http://vermontamerican.com/products/standard-drill-bit-extensions/"
thepage = urllib.request.urlopen(theurl)
soup = BeautifulSoup(thepage,"html.parser")
for part in soup.find_all('td'),{"class":"column-1"}:
part1 = part.text
print(part1)
Wenn ich Linie nehmen 2 und drucken nur „Teil“ oben ich ein Ergebnis bekommen, aber es ist was alle td nicht nur column-1. Ich habe das auch versucht, aber ich bin neu, ich bin mir sicher, dass das in mehr als einer Hinsicht falsch ist.
import urllib
import urllib.request
from bs4 import BeautifulSoup
theurl="http://vermontamerican.com/products/standard-drill-bit-extensions/"
thepage = urllib.request.urlopen(theurl)
soup = BeautifulSoup(thepage,"html.parser")
for part in soup.find('tbody'),{"class":"row-hover"}:
for part1 in part.find_all('a'):
print(part1)
Oh, ich bin ein Idiot !! Vielen Dank!! – PatrickP76