Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec150badba |
1
requirements.txt
Normal file
1
requirements.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
selenium~=4.33.0
|
||||||
8
run.py
8
run.py
@ -1,5 +1,5 @@
|
|||||||
import time
|
|
||||||
import selenium.common
|
import selenium.common
|
||||||
|
|
||||||
from utils import Bing
|
from utils import Bing
|
||||||
|
|
||||||
User_profile_chrome = ["chromium"]
|
User_profile_chrome = ["chromium"]
|
||||||
@ -8,15 +8,15 @@ def main():
|
|||||||
try:
|
try:
|
||||||
driver = Bing.init_driver()
|
driver = Bing.init_driver()
|
||||||
Bing.get_points(driver=driver)
|
Bing.get_points(driver=driver)
|
||||||
time.sleep(10)
|
|
||||||
Bing.get_points(driver=driver)
|
|
||||||
time.sleep(10)
|
|
||||||
driver.quit()
|
driver.quit()
|
||||||
print("quit")
|
print("quit")
|
||||||
|
|
||||||
except selenium.common.exceptions.WebDriverException as e:
|
except selenium.common.exceptions.WebDriverException as e:
|
||||||
print(e)
|
print(e)
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
2
utils.py
2
utils.py
@ -14,7 +14,7 @@ class Bing:
|
|||||||
options = Options()
|
options = Options()
|
||||||
# options.add_argument("--headless") # Run in headless mode
|
# options.add_argument("--headless") # Run in headless mode
|
||||||
options.add_argument("--no-sandbox")
|
options.add_argument("--no-sandbox")
|
||||||
options.add_experimental_option("detach", True)
|
options.add_experimental_option("detach", False)
|
||||||
options.add_argument("--disable-dev-shm-usage")
|
options.add_argument("--disable-dev-shm-usage")
|
||||||
options.add_argument(f"--user-data-dir=/tmp/chrome-profile")
|
options.add_argument(f"--user-data-dir=/tmp/chrome-profile")
|
||||||
# options.add_argument(f"--user-data-dir=C:\\Users\\Plane\\AppData\\Local\\Microsoft\\Edge\\{profile_path}")
|
# options.add_argument(f"--user-data-dir=C:\\Users\\Plane\\AppData\\Local\\Microsoft\\Edge\\{profile_path}")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user