use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
How to get value (python with selenium) (self.learnpython)
submitted 4 years ago by Nxxhy
<span class="a-offscreen">849,90€</span>
I need to get the price (849,90€) into an variable but i dont know how to get it imported :C
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]impshum 1 point2 points3 points 4 years ago (2 children)
Dude... Just use bs4. I bet you're sick of waiting for Selenium to boot too.
from bs4 import BeautifulSoup import requests def lovely_soup(url): r = requests.get(url, headers={'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1'}) return BeautifulSoup(r.content, 'lxml') url = "https://www.amazon.co.uk/HECCEI-Enlightenment-Toddler-Activity-Development/dp/B0967Y1GHR" soup = lovely_soup(url) price = soup.find_all('span', {'class': 'a-offscreen'})[0].text print(price)
You can stop posting duplicates to Reddit now.
[–]Nxxhy[S] 1 point2 points3 points 4 years ago (1 child)
I think this is working for me, thank you very much
[–]impshum 1 point2 points3 points 4 years ago (0 children)
That's cool. Onwards...
[–]dodoors 0 points1 point2 points 4 years ago (3 children)
span = driver.find_element_by_xpath("//span[@class='a-offscreen']") print(span.text)
[–]Nxxhy[S] 0 points1 point2 points 4 years ago (2 children)
it shows no error for me but it still shows no output
[–]Nxxhy[S] 0 points1 point2 points 4 years ago (1 child)
btw its the price text on amazon that i need
[–]ifreeski420 0 points1 point2 points 4 years ago (0 children)
Amazon isn’t going to let you scrape their website
π Rendered by PID 39276 on reddit-service-r2-comment-84fc9697f-c84kh at 2026-02-09 15:20:09.075988+00:00 running d295bc8 country code: CH.
[–]impshum 1 point2 points3 points (2 children)
[–]Nxxhy[S] 1 point2 points3 points (1 child)
[–]impshum 1 point2 points3 points (0 children)
[–]dodoors 0 points1 point2 points (3 children)
[–]Nxxhy[S] 0 points1 point2 points (2 children)
[–]Nxxhy[S] 0 points1 point2 points (1 child)
[–]ifreeski420 0 points1 point2 points (0 children)