A small example package
Project description
Universal Web Scraping Code Created by AI
from coparser.amazon_com import *
def get_html(url):
import time
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.launch(headless=False)
page = browser.new_page()
page.goto(url,wait_until='domcontentloaded')
time.sleep(10)
page_source = page.content()
browser.close()
with open("debug.html", "w", encoding="utf-8") as file:
file.write(page_source)
return page_source
if __name__ == '__main__':
import lxml.html
url='https://www.amazon.com/dp/B0D8GB6VRD/ref=sspa_dk_detail_2'
html=get_html(url)
tree = lxml.html.fromstring(html)
result={}
result['SellPrice']=extract_SellPrice(tree)
result['ProductName']=extract_ProductName(tree)
result['TotalReview']=extract_TotalReview(tree)
result['Availability']=extract_Availability(tree)
result['ProductImage']=extract_ProductImage(tree)
result['AverageReview']=extract_AverageReview(tree)
print(result)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
coparser-0.0.4.tar.gz
(366.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file coparser-0.0.4.tar.gz.
File metadata
- Download URL: coparser-0.0.4.tar.gz
- Upload date:
- Size: 366.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0053f54924f385ca2ee5ff9ce763d0f1031489720cd34fd56cb601c64b2a780
|
|
| MD5 |
cd87525c4ea3f1c6b6bac9af3e7110ea
|
|
| BLAKE2b-256 |
d497001884651f6dbe20f7d5b49929c0151484a180bbf1a7e742117195268c31
|
File details
Details for the file coparser-0.0.4-py3-none-any.whl.
File metadata
- Download URL: coparser-0.0.4-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0edcf924d1928548261566db57598358edf9ddc45b3eef0c2572be64fa5a9e42
|
|
| MD5 |
21cbd31b707437576fda1328277b066a
|
|
| BLAKE2b-256 |
bcc4493fcbbbd094dce6f8a536c4072e17a0ff047c893c4306052e35d788fbde
|