Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98787

Python, BS and Selenium

$
0
0

I try to webscrap with javascript dynamic + bs + python and Ive read a lot of things to come up with this code where I try to scrap a price rendered with javascript on a famous website for example:

from bs4 import BeautifulSoup
from selenium import webdriver

url = "https://www.nespresso.com/fr/fr/order/capsules/original/"

browser = webdriver.PhantomJS(executable_path = "C:/phantomjs-2.1.1-windows/bin/phantomjs.exe")
browser.get(url)
html = browser.page_source

soup = BeautifulSoup(html, 'lxml')

soup.find("span", {'class':'ProductListElement__price'}).text

But I only have as a result '\xa0' which is the source value, not the javascript value and I don't know really what I did wrong ...

Best regards


Viewing all articles
Browse latest Browse all 98787

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>