Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
created webscarping.py for html parsing
  • Loading branch information
cherukuri12 authored Oct 1, 2019
commit 558fda89480519de817662e373fbcb6731f3e180
22 changes: 22 additions & 0 deletions scripts/webscraping.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import requests
from bs4 import BeautifulSoup

def cars_brand_links():
url = 'https://www.carsprite.com/en/car-prices'
source_code = requests.get(url)
plain_text = source_code.text
soup = BeautifulSoup(plain_text)
for link in soup.findAll("a"):
href = link.get('href')
if "car-prices" not in href:
pass
else:
data = href
i = 9
while i < 49:
print(data[i])
i += 1



cars_brand_links()