-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ce96c2
commit ccd12be
Showing
1 changed file
with
18 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,35 +25,36 @@ jobs: | |
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
# Setup Chrome and ChromeDriver | ||
- name: Setup Chrome and ChromeDriver | ||
uses: browser-actions/[email protected] | ||
with: | ||
chrome-version: 120 # Match your target Chrome version | ||
install-chromedriver: true | ||
# Ensure CHROME_BIN and CHROMEDRIVER_PATH are exported | ||
- name: Export Chrome and ChromeDriver Paths | ||
- name: Install Chrome and ChromeDriver | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y google-chrome-stable | ||
sudo apt-get install -y chromium-chromedriver | ||
# Ensure chromedriver is in PATH | ||
sudo ln -s /usr/lib/chromium-browser/chromedriver /usr/local/bin/chromedriver | ||
env: | ||
CHROME_BIN: "/usr/bin/google-chrome" | ||
CHROMEDRIVER_PATH: "/usr/local/bin/chromedriver" | ||
|
||
- name: Verify ChromeDriver Installation | ||
run: | | ||
echo "CHROME_BIN=/usr/bin/google-chrome" >> $GITHUB_ENV | ||
echo "CHROMEDRIVER_PATH=$(which chromedriver)" >> $GITHUB_ENV | ||
which chromedriver | ||
chromedriver --version | ||
# Run the scraper | ||
- name: Run Scraper | ||
env: | ||
CHROME_BIN: ${{ env.CHROME_BIN }} # Pass Chrome binary path to your script | ||
CHROMEDRIVER_PATH: ${{ env.CHROMEDRIVER_PATH }} # Pass ChromeDriver path to your script | ||
CHROME_BIN: "/usr/bin/google-chrome" | ||
CHROMEDRIVER_PATH: "/usr/local/bin/chromedriver" | ||
run: | | ||
python main.py | ||
- name: Save Excel Output | ||
# Create a file name with the date and time | ||
run: | | ||
timestamp=$(date +"%Y-%m-%d_%H-%M-%S") | ||
mv output.xlsx "output_$timestamp.xlsx" | ||
mv "output_$timestamp.xlsx" results/ | ||
- name: Commit and Push the Excel file | ||
run: | | ||
git config --local user.email "[email protected]" | ||
|