beautifulsoup - Beautiful Soup Scrape not showing properly -
i'm doing simple, , results not showing properly. website bed bath & beyond. i'm trying product totals per category.
my script looks this.
r = requests.get("http://www.bedbathandbeyond.com/store/category/bed-bath/bedding-accessories/10505/") soup = beautifulsoup(r.content) li = soup.find_all("li", {"class" : "listcount nopadleft"}) l in li: print(l.text)
and outputting nothing, though know there text in elements. need inside 1 element, found when wasn't working find_all instead try , figure out going on.
this html of scraping:
<li class="listcount nopadleft"> <strong>showing 1 - 48 </strong> <span>of 124 product(s) </span> </li>
any ideas why happening?
try code (python 3):
import urllib.request rq import bs4 url=rq.urlopen('http://www.bedbathandbeyond.com/store/category/bed-bath/bedding-accessories/10505/').read().decode('utf-8') soup=bs4.beautifulsoup(url) a=soup.find_all('li',class_="listcount nopadleft") in a: print(i.text)
Comments
Post a Comment