Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I need help!!!!
#2
Use Code Tag.
This look like homework?
I can give example how to start,then you have to try stuff yourself to solve the task.
import requests
from bs4 import BeautifulSoup

url = 'https://www.laugfssuper.com/index.php/coconut-105320.html'
response = requests.get(url)
soup = BeautifulSoup(response.content, 'lxml')
price = soup.find('div', class_="product-type-data")
Test.
>>> price
<div class="product-type-data"><div class="price-box"> <span class="regular-price" id="product-price-105320"> <span class="price">Rs.95.00</span> </span></div><p class="availability out-of-stock">Availability: <span>Out of stock</span></p></div>

>>> price.text.strip()
'Rs.95.00 Availability: Out of stock'
Reply


Messages In This Thread
I need help!!!! - by Nimesh_SDP - Apr-23-2022, 04:00 PM
RE: I need help!!!! - by snippsat - Apr-23-2022, 06:50 PM
RE: I need help!!!! - by Nimesh_SDP - Apr-24-2022, 04:47 AM
RE: I need help!!!! - by Gribouillis - Apr-24-2022, 08:56 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020