Spaces:
Sleeping
Sleeping
Added platform hangling
Browse files- code/web_scraper_allegro.py +1 -0
- code/web_scraper_ebay.py +1 -5
- code/web_scraper_olx.py +1 -0
code/web_scraper_allegro.py
CHANGED
|
@@ -132,6 +132,7 @@ def get_allegro_data(url):
|
|
| 132 |
return {
|
| 133 |
"title": title,
|
| 134 |
"sanitized_title": sanitize_name(title),
|
|
|
|
| 135 |
"url": url,
|
| 136 |
"description": description,
|
| 137 |
"parameters": parameter_list,
|
|
|
|
| 132 |
return {
|
| 133 |
"title": title,
|
| 134 |
"sanitized_title": sanitize_name(title),
|
| 135 |
+
"platform": "Allegro",
|
| 136 |
"url": url,
|
| 137 |
"description": description,
|
| 138 |
"parameters": parameter_list,
|
code/web_scraper_ebay.py
CHANGED
|
@@ -134,6 +134,7 @@ def get_ebay_data(url):
|
|
| 134 |
print(f"Found {len(unique_links)} unique images (High-Res).")
|
| 135 |
|
| 136 |
return {
|
|
|
|
| 137 |
"title": title,
|
| 138 |
"sanitized_title": sanitize_name(title),
|
| 139 |
"url": url,
|
|
@@ -147,8 +148,3 @@ def get_ebay_data(url):
|
|
| 147 |
except Exception as e:
|
| 148 |
print(f"Critical error occurred: {e}")
|
| 149 |
|
| 150 |
-
# --- USAGE ---
|
| 151 |
-
if __name__ == "__main__":
|
| 152 |
-
link = input("Enter the eBay offer link: ")
|
| 153 |
-
data = get_ebay_data(link)
|
| 154 |
-
print(json.dumps(data, indent=4, ensure_ascii=False))
|
|
|
|
| 134 |
print(f"Found {len(unique_links)} unique images (High-Res).")
|
| 135 |
|
| 136 |
return {
|
| 137 |
+
"platform": "Ebay",
|
| 138 |
"title": title,
|
| 139 |
"sanitized_title": sanitize_name(title),
|
| 140 |
"url": url,
|
|
|
|
| 148 |
except Exception as e:
|
| 149 |
print(f"Critical error occurred: {e}")
|
| 150 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
code/web_scraper_olx.py
CHANGED
|
@@ -80,6 +80,7 @@ def get_olx_data(url):
|
|
| 80 |
|
| 81 |
# --- RETURNING DICTIONARY ---
|
| 82 |
return {
|
|
|
|
| 83 |
"title": title,
|
| 84 |
"sanitized_title": sanitize_name(title),
|
| 85 |
"url": url,
|
|
|
|
| 80 |
|
| 81 |
# --- RETURNING DICTIONARY ---
|
| 82 |
return {
|
| 83 |
+
"platform": "OLX",
|
| 84 |
"title": title,
|
| 85 |
"sanitized_title": sanitize_name(title),
|
| 86 |
"url": url,
|