• 0

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191


File: /var/www/html/cnasolution/application/views/question.php
Line: 191
Function: _error_handler

File: /var/www/html/cnasolution/application/controllers/Questions.php
Line: 419
Function: view

File: /var/www/html/cnasolution/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Very basic web scraping query for you fine folk

Just working on a small project for which I'd like to web scrape the price of a particular item. I've never done this before and I'm having difficulty using a few methods.

This is the webpage in question: https://www.made.com/keira-office-chair-cloud-grey-and-copper

and this is the element in question:

£149 £149 The code I am trying is as follows: import requests, bs4

page = requests.get(URL,headers={"User-Agent":"Defined"}) page.raise_for_status() soup = bs4.BeautifulSoup(page.content, 'html.parser') price = soup.find('ProductPrice__Price-rtg8id-1 jYfukd').get_text() print(price)```   The error I receive is:  ttributeError: 'NoneType' object has no attribute 'get_text'   I had a look around it appears an easier method of doing what I am attempting is to use a CSS selector, however I have tried that (perhaps incorrectly) and when I run my script, it just returns '[]'.  Could somebody kindly explain what I am doing wrong, or what I should be looking for? Thanks a lot and Merry Christmas. 
Download script demo [LINK]
Download script demo [LINK 2] Download script demo [LINK 2]