You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "/usr/local/bin/.pyenv/versions/3.10.14/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/local/bin/.pyenv/versions/3.10.14/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/www/wwwroot/45.77.173.161/mutasi/Amuba/src/BCA/bca.py", line 59, in run
options = webdriver.ChromeOptions()
File "/usr/local/bin/.pyenv/versions/3.10.14/lib/python3.10/site-packages/selenium_driverless/types/options.py", line 52, in __init__
self._binary_location = find_chrome_executable()
File "/usr/local/bin/.pyenv/versions/3.10.14/lib/python3.10/site-packages/selenium_driverless/utils/utils.py", line 38, in find_chrome_executable
for item in os.environ.get("PATH").split(os.pathsep):
AttributeError: 'NoneType' object has no attribute 'split'
In some reason script.py which called by script.php can not get PATH environment. so the PATH value will be None. Which cause this problem Note:
php => can get the PATH environment
python CLI => can get the PATH environment
python script called by php => can not get the PATH environment (idk why this is happend -_- )
i have no problem with my own script. because i still can fix it with:
if(os.environ.get('PATH') isNone):
if(platform.system()=='Windows'):
os.environ["PATH"] =""#should be Program Files and Program Files (x86) hereelse:
os.environ["PATH"] ="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"options=webdriver.ChromeOptions()
options.add_argument("--headless=new")
options.add_argument("--no-sandbox")
options.binary_location="/usr/bin/google-chrome"asyncwithwebdriver.Chrome(options=options, debug=False) asself.driver:
awaitself.main()
The reason why open this issue is because of this code:
above code will try to find all chrome candidates, before i put the options.binary_location
options=webdriver.ChromeOptions() # find all chrome executable candidateoptions.binary_location="/usr/bin/google-chrome"# override the candidateasyncwithwebdriver.Chrome(options=options, debug=True) asself.driver:
awaitself.main()
i think we can let self._binary_location=None first. Then we can try find candidate if self._binary_location is None when webdriver.Chrome() called. But if this is too complicated to fix, i think we can ignore it right now
There is no None checking, so if PATH is not found in environment , it will cause fatal error.
I think that you just forgot it, because for Windows, you already have None checking
Thanks
The text was updated successfully, but these errors were encountered:
i write script into
script.py
and call it withscript.php
from website (not CLI)script.py
i got this error:
In some reason
script.py
which called byscript.php
can not get PATH environment. so the PATH value will be None. Which cause this problemNote:
php => can get the PATH environment
python CLI => can get the PATH environment
python script called by php => can not get the PATH environment (idk why this is happend -_- )
i have no problem with my own script. because i still can fix it with:
The reason why open this issue is because of this code:
A. Minor Issue
Selenium-Driverless/src/selenium_driverless/types/options.py
Line 52 in 88625e9
above code will try to find all chrome candidates, before i put the
options.binary_location
i think we can let
self._binary_location=None
first. Then we can try find candidate ifself._binary_location is None
whenwebdriver.Chrome()
called. But if this is too complicated to fix, i think we can ignore it right nowB. Major Issue
Selenium-Driverless/src/selenium_driverless/utils/utils.py
Lines 37 to 46 in 88625e9
There is no
None
checking, so ifPATH
is not found in environment , it will cause fatal error.I think that you just forgot it, because for Windows, you already have
None
checkingThanks
The text was updated successfully, but these errors were encountered: