Skip to content

Instantly share code, notes, and snippets.

@vishal2612200
Created October 2, 2018 05:05
Show Gist options
  • Save vishal2612200/bcb3985ecd5566365e901a0966dc1327 to your computer and use it in GitHub Desktop.
Save vishal2612200/bcb3985ecd5566365e901a0966dc1327 to your computer and use it in GitHub Desktop.
from urllib.request import urlopen
from bs4 import BeautifulSoup
import requests
page=urlopen("https://www.cardekho.com/")
soup = BeautifulSoup(page.read(),"html5lib")
new =soup.find_all("div",{"class":"price"})
len(new) #to count the number of price class element i.e testing purpose
print(new[0].text)#for testing the link
about=new[0]
for about in new:
print(about.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment