Skip to content

Commit 57ce9c8

Browse files
committed
updated for new cookie consent
1 parent cbc3441 commit 57ce9c8

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
/dist
2+
/build
23

4+
__pycache__/*
5+
6+
t3_scraper.spec

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pip install selenium beautifulsoup4 webdriver-manager
2020
1. Run the script:
2121

2222
```bash
23-
python T3_Scraper.py
23+
python t3_scraper.py
2424
```
2525

2626
2. The script will:
@@ -51,7 +51,7 @@ pip install pyinstaller
5151
2. Navigate to the directory containing your script and run the following command:
5252

5353
```bash
54-
pyinstaller --onefile T3_Scraper.py
54+
pyinstaller --onefile t3_scraper.py
5555
```
5656

5757
This will generate a standalone executable in the `dist` directory. You can run this executable without needing to install Python or any dependencies on the target machine.
@@ -61,7 +61,7 @@ This will generate a standalone executable in the `dist` directory. You can run
6161
On Linux, ensure that the generated executable is set as executable by running:
6262

6363
```bash
64-
chmod +x dist/T3_Scraper dist/run_scraper.sh
64+
chmod +x dist/t3_scraper dist/run_scraper.sh
6565
```
6666

6767
**Running the Script**

T3_Scraper.py renamed to t3_scraper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050

5151
# Try to click on the cookie consent button if it's present
5252
try:
53-
cookie_button = driver.find_element(By.CSS_SELECTOR, 'body > div.fc-consent-root > div.fc-dialog-container > div.fc-dialog.fc-choice-dialog > div.fc-footer-buttons-container > div.fc-footer-buttons > button.fc-button.fc-cta-consent.fc-primary-button')
53+
# Use the new CSS selector for the button
54+
cookie_button = driver.find_element(By.CSS_SELECTOR, 'button.css-47sehv span')
5455
cookie_button.click()
5556
print("Cookie consent clicked.")
5657
except:

0 commit comments

Comments
 (0)