procom / del.py
thejagstudio's picture
Upload 185 files
0bd6e09
raw
history blame
578 Bytes
import http.client
from bs4 import BeautifulSoup
import json
conn = http.client.HTTPSConnection("www.amazon.in")
payload = ''
headers = {}
conn.request("POST", "/dp/B0BJMCKYCY/", payload, headers)
res = conn.getresponse()
data = res.read()
response = data.decode("utf-8")
soup = BeautifulSoup(response, features="html5lib")
data = soup.find_all("script")
dataArr = {}
for i in data:
try:
temp = str(i).split("<script")[1].split(">")[1].split("</script")[0]
for key, item in json.loads(temp).items():
dataArr[key] = item
except:
pass