I wish to extract some information from a dynamic website.
from selenium import webdriver
import time
driver = webdriver.PhantomJS(executable_path='/Users/xxx/anaconda/phantomjs-2.0.0-macosx/bin/phantomjs')
driver.get("http://pythonscraping.com/pages/javascript/ajaxDemo.html")
time.sleep(3)
print(driver.find_element_by_id("content").text)
driver.close()
When I run the above code, I get the following error message:
"selenium.common.exceptions.WebDriverException: Message:
Can not connect to GhostDriver on port 61121"
Any ideas why?
Related
I have this script that was able to connect to a browser that is run by this command:
"c:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --remote-debugging-port=9222. For some reason, it stopped working.
from selenium import webdriver
from selenium.webdriver.edge.options import Options
edge_options = Options()
edge_options.add_experimental_option('debuggerAddress', '127.0.0.1:9222')
driver = webdriver.Edge(options=edge_options)
driver.get(youtube.com)
print(driver.title)
Part of the error message is this:
Message: unknown error: cannot connect to microsoft edge at 127.0.0.1:9222
from chrome not reachable
Two questions about this message:
Could I just connect to the IP address of the "real" browser?
Why is there written chrome instead of chromium?
This is a full error message it makes me swallow.
https://i.stack.imgur.com/mGL4d.png
Whenever I type the following code, it throws an error and I am not able to connect to my driver window:
driver = webdriver.Chrome("chromedriver.exe")
Error message: InvalidArgumentException
Download chromedriver.exe
Set executable_path to the location where your chromedriver is located.
replace driver = webdriver.Chrome("chromedriver.exe") to
driver = webdriver.Chrome()
Chekc It will work or not.
for more info check below link
https://stackoverflow.com/a/42478941/6559285
it opens the window like this
and give following error in console
[6368:4624:0318/004504.962:ERROR:device_event_log_impl.cc(214)] [00:45:04.962] Bluetooth:
bluetooth_adapter_winrt.cc:1072 Getting Default Adapter failed.
[6368:10732:0318/004506.024:ERROR:data_store_impl.cc(131)] Failed to open Data Reduction Proxy DB: 3
here is my selenium script
from selenium import webdriver
driver=webdriver.Chrome(executable_path=r'C:\Users\User\Downloads\chromedriver.exe')
driver.get("https://www.google.com/")
I am running a script with Selenium that loops over a number of URLs. However, some URLs give a 503 service error. For example the following code gives me such an error.
import requests
import selenium
from selenium import webdriver
url = 'https://destyy.com/q3P5W7'
driver = webdriver.Chrome()
driver.get(url)
response = requests.get(driver.current_url).status_code
I tried refreshing the browser in the case of an error, but then the error persists.
if response == 503:
driver.refresh()
I noticed that if I manually select the url in the address bar of my driver and press enter, the page loads to the desired location. I tried to write this into code but it fails:
from selenium.webdriver.common.keys import Keys
address_bar = driver.find_element_by_xpath('/html/body').send_keys(Keys.CONTROL, "l")
address_bar.sendKeys(Keys.ENTER)
Please help me out. How can I load the page? Thanks in advance,
I'm trying to get a webpage with Selenium with this code :
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
IEdriver= 'C:\Program Files\Internet Explorer\iexplore.exe'
browser = webdriver.Ie(IEdriver)
browser.get('www.google.com')
When IE is open, it tries to connect to :
http://--port=60803/
And I can't connect to Google. Does anyone know why ?
EDIT:
The exception is :
WebDriverException("Can not connect to the Se
selenium.common.exceptions.WebDriverException: Message:
ervice C:\Program Files\Internet Explorer\iexplore.exe
You should add scheme (application layer protocol you want to use) to URL, so replace
browser.get('www.google.com')
with
browser.get('https://www.google.com')
Also there is another problem in your code:
IEdriver= 'C:\Program Files\Internet Explorer\iexplore.exe' points on IE browser binary file while webdriver.Ie() should get path to IEDriverServer.exe as value for executable_path parameter