Ich weiß nicht, was das Problem ist, aber es auf dem gleichen Ding mehrere Male drucken. Wenn mir jemand helfen kann, wird es sehr geschätzt. DankeDrucken Sie die gleiche Sache mehrmals
from bs4 import BeautifulSoup
from urllib.parse import urlparse
import urllib.request
req = urllib.request.Request('http://shopnicekicks.com/products/a-ma-maniere-x-diadora-n9000-mens-brown-sugar.xml')
res = urllib.request.urlopen(req)
end = res.geturl()
soup = BeautifulSoup(res, 'lxml')
parsed = urlparse(end)
for variant in soup.variants.find_all("id", {"type": "integer"}):
cart = 'http://'+parsed.netloc+'/cart/' +variant.text+':1'
for size in soup.variants.find_all('title'):
print(cart, size.text)
Was soll es drucken? Und wie soll das aus der Eingabe abgeleitet werden? Was wird gedruckt? – interjay
Es soll so drucken: http://shopnicekicks.com/cart/23839239105:1 8 http://shopnicekicks.com/cart/23839239169:1 8.5 http://shopnicekicks.com/cart/23839239233 : 1 9 http://shopnicekicks.com/cart/23839239297:1 9.5 http://shopnicekicks.com/cart/23839239361:1 10 http://shopnicekicks.com/cart/23839239425:1 10.5 http : //shopnicekicks.com/cart/23839239489: 1 11 http://shopnicekicks.com/cart/23839239553:1 12 http://shopnicekicks.com/cart/23839239617:1 13 – EdBiz