-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Download Path for Driver (Question) #951
Comments
I think this would get resolved with #643. Thanks! |
hi @ottogutierrez ! Maybe I'm facing the same problem as you. can you give me some tips? thank you very much! there is my code: from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_dir = '/opt/chrome'
chrome_path = chrome_dir + '/headless-chromium'
chrome_driver_path = chrome_dir + '/chromedriver'
def create_undetected_driver():
import undetected_chromedriver as uc
from undetected_chromedriver.options import ChromeOptions
chrome_options = ChromeOptions()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--single-process')
chrome_options.add_argument('--disable-dev-shm-usage')
chrome_options.add_argument("--disable-gpu")
chrome_options.binary_location = chrome_path
return uc.Chrome(driver_executable_path=chrome_driver_path,
headless=True,
options=chrome_options,
use_subprocess=False,
user_data_dir="/tmp")
def lambda_handler(event, context):
"""The actual function that will be called"""
driver = create_undetected_driver()
try:
url = 'https://nowsecure.nl'
driver.get(url)
image = driver.get_screenshot_as_base64()
return {
'headers': { "Content-Type": "image/png" },
'statusCode': 200,
'body': image,
'isBase64Encoded': True
}
finally:
driver.quit()
return {
'statusCode': 200,
'body': json.dumps(str(event))
} the error: Thanks again! |
Hello, I'm currently trying to use undetected_chromedriver in AWS as a lambda function.
So far, I have created the layer with the "undetected_chromedriver" library included. However, as I understand, the library automatically downloads the correct driver according to the machine. Since it is running in an AWS lambda function, it appears that only the '/tmp/' folder is available (Linux based system).
Is there a way to modify the download folder for the chromedriver?
This is the error I encounter
Thanks!
The text was updated successfully, but these errors were encountered: