Hardeepex / scrapegost

Other
0 stars 0 forks source link

sweep: provide me all css selectors for content for selectolax #10

Closed Hardeepex closed 6 months ago

Hardeepex commented 6 months ago
Checklist - [X] Modify `docs/examples/tutorial/redflagdeals_scraper.py` ✓ https://github.com/Hardeepex/scrapegost/commit/a53e451d9659b74837cc2291a418d7802299642b [Edit](https://github.com/Hardeepex/scrapegost/edit/sweep/provide_me_all_css_selectors_for_content_1/docs/examples/tutorial/redflagdeals_scraper.py#L18-L25) - [X] Running GitHub Actions for `docs/examples/tutorial/redflagdeals_scraper.py` ✓ [Edit](https://github.com/Hardeepex/scrapegost/edit/sweep/provide_me_all_css_selectors_for_content_1/docs/examples/tutorial/redflagdeals_scraper.py#L18-L25) - [X] Create `tests/live/test_new_scraper.py` ✓ https://github.com/Hardeepex/scrapegost/commit/de65ed7faa208042b58c260aa323d2e2a4f36141 [Edit](https://github.com/Hardeepex/scrapegost/edit/sweep/provide_me_all_css_selectors_for_content_1/tests/live/test_new_scraper.py) - [X] Running GitHub Actions for `tests/live/test_new_scraper.py` ✓ [Edit](https://github.com/Hardeepex/scrapegost/edit/sweep/provide_me_all_css_selectors_for_content_1/tests/live/test_new_scraper.py)
sweep-ai[bot] commented 6 months ago

🚀 Here's the PR! #12

See Sweep's progress at the progress dashboard!
💎 Sweep Pro: I'm using GPT-4. You have unlimited GPT-4 tickets. (tracking ID: 4eab7df4bc)

[!TIP] I'll email you at hardeep.ex@gmail.com when I complete this pull request!


Actions (click)

Sandbox Execution ✓

Here are the sandbox execution logs prior to making any changes:

Sandbox logs for f0a2d7b
Checking docs/examples/tutorial/redflagdeals_scraper.py for syntax errors... ✅ docs/examples/tutorial/redflagdeals_scraper.py has no syntax errors! 1/1 ✓
Checking docs/examples/tutorial/redflagdeals_scraper.py for syntax errors...
✅ docs/examples/tutorial/redflagdeals_scraper.py has no syntax errors!

Sandbox passed on the latest main, so sandbox checks will be enabled for this issue.


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I think are relevant in decreasing order of relevance (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/Hardeepex/scrapegost/blob/f0a2d7b7ab15197c9cbc685f7996227d257a7abb/docs/examples/tutorial/redflagdeals_scraper.py#L13-L25 https://github.com/Hardeepex/scrapegost/blob/f0a2d7b7ab15197c9cbc685f7996227d257a7abb/tests/live/test_live.py#L55-L59 https://github.com/Hardeepex/scrapegost/blob/f0a2d7b7ab15197c9cbc685f7996227d257a7abb/docs/tutorial.md#L65-L68
I also found the following external resources that might be helpful: **Summaries of links found in the content:** https://w.dam-img.rfdcontent.com/offers/013/736/864/200x200_pad.jpg: The page contains a list of deals from different merchants. The first deal is a sponsored offer for a Samsung 77" OLED 4K Smart TV, which is $1000 off. The offer includes a description of the TV's features such as deep blacks, clean whites, and full shades of lively colors. The second deal is from Kitchen Stuff Plus, offering 50% off the Ballarini Bologna Non-Stick Wok & Frypan Set and more. The third deal is from the PlayStation Store, offering free monthly games for PlayStation Plus members. The page also includes pagination for navigating through the deals. https://q.dam-img.rfdcontent.com/offers/013/736/863/100x100_pad.jpg: The page contains a list of deals from different merchants. The first deal is from Kitchen Stuff Plus, offering 50% off on the Ballarini Bologna Non-Stick Wok & Frypan Set. The second deal is from PlayStation Store, offering free monthly games for PlayStation Plus members. The page also includes pagination for navigating through the deals. https://p.dam-img.rfdcontent.com/offers/013/736/864/100x100_pad.jpg: The page contains information about two deals: a $1000 off 77" OLED 4K Smart TV from Samsung and 50% off Ballarini Bologna Non-Stick Wok & Frypan Set from Kitchen Stuff Plus. The Samsung TV features OLED technology with deep blacks, clean whites, and full shades of lively colors. It also has 4K AI upscaling and a Dolby Atmos experience. The Kitchen Stuff Plus deal includes various red hot deals. The page also includes pagination for more deals and a footer with additional information. https://t.dam-img.rfdcontent.com/offers/013/736/863/100x100_pad.jpg: The page contains a list of deals from different merchants. The first deal is from Kitchen Stuff Plus, offering 50% off on the Ballarini Bologna Non-Stick Wok & Frypan Set. The second deal is from PlayStation Store, offering free monthly games for PlayStation Plus members. The page also includes pagination for navigating through the deals. https://tpc.googlesyndication.com/simgad/461817906561256968: The page contains a list of deals from different merchants. The first deal is a $1000 off 77" OLED 4K Smart TV from Samsung. The deal includes a description of the TV's features such as deep blacks, clean whites, and full shades of lively colors. The second deal is about free monthly games for PlayStation Plus subscribers. The games mentioned are A Plague Tale Requiem and Evil West. The page also includes pagination for navigating through the deals. https://h.dam-img.rfdcontent.com/offers/013/736/863/200x200_pad.jpg: The page contains a list of deals from different merchants. The first deal is a sponsored offer for a $1000 discount on a 77" OLED 4K Smart TV from Samsung. The second deal is from Kitchen Stuff Plus, offering 50% off on a Ballarini Bologna Non-Stick Wok & Frypan Set. The third deal is from PlayStation Store, offering free monthly games for PlayStation Plus members. The page also includes pagination for navigating through the deals. https://o.dam-img.rfdcontent.com/offers/013/736/864/100x100_pad.jpg: The page contains information about two deals: a $1000 off 77" OLED 4K Smart TV from Samsung and 50% off Ballarini Bologna Non-Stick Wok & Frypan Set from Kitchen Stuff Plus. The Samsung TV features OLED technology with deep blacks, clean whites, and full shades of lively colors. It also has 4K AI upscaling and a Dolby Atmos experience. The Kitchen Stuff Plus deal includes various red hot deals. The page also includes pagination for more deals and a footer with additional information.

Step 2: ⌨️ Coding

--- 
+++ 
@@ -11,7 +11,7 @@
         "dealer": "str",
         "comments_count": "int",
     },
-    extra_preprocessors=[CSS("div.list_item")],
+    extra_preprocessors=[CSS("div.list_item"), CSS("a.offer_image"), CSS("h2.offer_title"), CSS("p.offer_description")],
 )

 # Define the SchemaScraper for the single deal pages
@@ -19,6 +19,8 @@
     {
         "title": "str",
         "url": "url",
+        "image": "url",
+        "description": "str",
         "price": "float",
         "regular_price": "float",
         "details": "str",

Ran GitHub Actions for a53e451d9659b74837cc2291a418d7802299642b:

Ran GitHub Actions for de65ed7faa208042b58c260aa323d2e2a4f36141:


Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/provide_me_all_css_selectors_for_content_1.


🎉 Latest improvements to Sweep:


💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord

Hardeepex commented 6 months ago

sweep: how it will work like for example i need for this url https://www.redflagdeals.com/deals/