Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 not getting image src in my BeautifulSoup csv file
#11
yes product url and iamge url are different. They are not same. You can see my full code
Quote
#12
I ask because you started to speak of multiple img links, but getting one product link in the csv file
(Sep-14-2020, 04:00 PM)farhan275 Wrote: I am getting multiple images url for every product
(Sep-14-2020, 04:00 PM)farhan275 Wrote: But in my csv still now getting only one product url from each product

In my opinion (not able to test) but your latest code
with io.open("amazon.csv", "a",encoding="utf-8") as f:
    for url in dpsoup.select('span.a-button-text > img')[3:10]:
        print(f"image link:{url['src']}")
        writeFile = csv.writer(f)
        writeFile.writerow([url['src'],product_link ,title,rating,price]) 
should write multiple img urls per product (each on different line)
The only explanation is that the code you run is actually different from the one you show here.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Quote

Top Page

Forum Jump:


Users browsing this thread: 1 Guest(s)