Joel
2018-11-19 17:12:28 UTC
Since Google denies access to API key of Google MyBusiness to all but
established firms, I attempted to automate the process of change my
business information using selenium webdriver.
What works?
Logging in to Google Mybusiness by automating the login form.
*What doesnt work?*
After logging in, I need to open the small modal of editing working hours.
I attempted to automate a click on the edit button, but unfortunately I am
getting this error: `http.client.RemoteDisconnected: Remote end closed
connection without response`
* What version of Selenium are you using ? 3.14.1
* Do you have the link to a public facing site which can be used to
reproduce the problem (or) atleast a complete HTML page source of the page ?
No, because it contains too much of private information, which is difficult
to scrub
* What flavor of browser are you using and what is its version ? Google
Chrome 70.0.3538.77 (Official Build) (64-bit)
* Operating system name and version. Ubuntu 18.04.1 LTS
My code:
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument("start-maximized")
driver = webdriver.Chrome(chrome_options=options)
def LoginGMB(driver):
(myemail, mypassword) = AuthenticationDetails()
driver.find_element_by_id('identifierId').send_keys(myemail)
driver.find_element_by_id('identifierNext').click()
time.sleep(2)
driver.find_element_by_name('password').send_keys(mypassword)
driver.find_element_by_id('passwordNext').click()
time.sleep(2)
def OpenGMB(url):
driver.get(url)
print(driver.current_url)
pattern = re.compile(".*accounts.google.com/signin.*")
match = re.search(pattern, cururl)
if match:
LoginGMB(driver)
print("Ok we're back")
driver.find_element_by_id('ow50').click()
OpenGMB('https://business.google.com/edit/l/001?hl=en')
Stacktrace:
https://accounts.google.com/signin/v2/identifier?service=lbc&passive=1209600
&continue
We need to login as we are presented login page
Ok we're back
Traceback (most recent call last):
File
"/home/joel/.local/lib/python3.6/site-packages/urllib3/connectionpool.py",
line 600, in urlopen
chunked=chunked)
File
"/home/joel/.local/lib/python3.6/site-packages/urllib3/connectionpool.py",
line 384, in _make_request
six.raise_from(e, None)
File "<string>", line 2, in raise_from
File
"/home/joel/.local/lib/python3.6/site-packages/urllib3/connectionpool.py",
line 380, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse
response.begin()
File "/usr/lib/python3.6/http/client.py", line 297, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.6/http/client.py", line 266, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without
response
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "gmb.py", line 77, in <module>
OpenGMB(url)
File "gmb.py", line 62, in OpenGMB
el = driver.find_element_by_id('ow50')
File
"/home/joel/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py",
line 360, in find_element_by_id
return self.find_element(by=By.ID, value=id_)
File
"/home/joel/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py",
line 978, in find_element
'value': value})['value']
File
"/home/joel/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py",
line 319, in execute
response = self.command_executor.execute(driver_command, params)
File
"/home/joel/.local/lib/python3.6/site-packages/selenium/webdriver/remote/remote_connection.py",
line 376, in execute
return self._request(command_info[0], url, body=data)
File
"/home/joel/.local/lib/python3.6/site-packages/selenium/webdriver/remote/remote_connection.py",
line 399, in _request
resp = self._conn.request(method, url, body=body, headers=headers)
File "/home/joel/.local/lib/python3.6/site-packages/urllib3/request.py",
line 72, in request
**urlopen_kw)
File "/home/joel/.local/lib/python3.6/site-packages/urllib3/request.py",
line 150, in request_encode_body
return self.urlopen(method, url, **extra_kw)
File "/home/joel/.local/lib/python3.6/site-packages/urllib3/poolmanager.py",
line 323, in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
File
"/home/joel/.local/lib/python3.6/site-packages/urllib3/connectionpool.py",
line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "/home/joel/.local/lib/python3.6/site-packages/urllib3/util/retry.py",
line 367, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/home/joel/.local/lib/python3.6/site-packages/urllib3/packages/six.py",
line 685, in reraise
raise value.with_traceback(tb)
File
"/home/joel/.local/lib/python3.6/site-packages/urllib3/connectionpool.py",
line 600, in urlopen
chunked=chunked)
File
"/home/joel/.local/lib/python3.6/site-packages/urllib3/connectionpool.py",
line 384, in _make_request
six.raise_from(e, None)
File "<string>", line 2, in raise_from
File
"/home/joel/.local/lib/python3.6/site-packages/urllib3/connectionpool.py",
line 380, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse
response.begin()
File "/usr/lib/python3.6/http/client.py", line 297, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.6/http/client.py", line 266, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.',
RemoteDisconnected('Remote end closed connection without response',))
established firms, I attempted to automate the process of change my
business information using selenium webdriver.
What works?
Logging in to Google Mybusiness by automating the login form.
*What doesnt work?*
After logging in, I need to open the small modal of editing working hours.
I attempted to automate a click on the edit button, but unfortunately I am
getting this error: `http.client.RemoteDisconnected: Remote end closed
connection without response`
* What version of Selenium are you using ? 3.14.1
* Do you have the link to a public facing site which can be used to
reproduce the problem (or) atleast a complete HTML page source of the page ?
No, because it contains too much of private information, which is difficult
to scrub
* What flavor of browser are you using and what is its version ? Google
Chrome 70.0.3538.77 (Official Build) (64-bit)
* Operating system name and version. Ubuntu 18.04.1 LTS
My code:
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument("start-maximized")
driver = webdriver.Chrome(chrome_options=options)
def LoginGMB(driver):
(myemail, mypassword) = AuthenticationDetails()
driver.find_element_by_id('identifierId').send_keys(myemail)
driver.find_element_by_id('identifierNext').click()
time.sleep(2)
driver.find_element_by_name('password').send_keys(mypassword)
driver.find_element_by_id('passwordNext').click()
time.sleep(2)
def OpenGMB(url):
driver.get(url)
print(driver.current_url)
pattern = re.compile(".*accounts.google.com/signin.*")
match = re.search(pattern, cururl)
if match:
LoginGMB(driver)
print("Ok we're back")
driver.find_element_by_id('ow50').click()
OpenGMB('https://business.google.com/edit/l/001?hl=en')
Stacktrace:
https://accounts.google.com/signin/v2/identifier?service=lbc&passive=1209600
&continue
We need to login as we are presented login page
Ok we're back
Traceback (most recent call last):
File
"/home/joel/.local/lib/python3.6/site-packages/urllib3/connectionpool.py",
line 600, in urlopen
chunked=chunked)
File
"/home/joel/.local/lib/python3.6/site-packages/urllib3/connectionpool.py",
line 384, in _make_request
six.raise_from(e, None)
File "<string>", line 2, in raise_from
File
"/home/joel/.local/lib/python3.6/site-packages/urllib3/connectionpool.py",
line 380, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse
response.begin()
File "/usr/lib/python3.6/http/client.py", line 297, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.6/http/client.py", line 266, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without
response
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "gmb.py", line 77, in <module>
OpenGMB(url)
File "gmb.py", line 62, in OpenGMB
el = driver.find_element_by_id('ow50')
File
"/home/joel/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py",
line 360, in find_element_by_id
return self.find_element(by=By.ID, value=id_)
File
"/home/joel/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py",
line 978, in find_element
'value': value})['value']
File
"/home/joel/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py",
line 319, in execute
response = self.command_executor.execute(driver_command, params)
File
"/home/joel/.local/lib/python3.6/site-packages/selenium/webdriver/remote/remote_connection.py",
line 376, in execute
return self._request(command_info[0], url, body=data)
File
"/home/joel/.local/lib/python3.6/site-packages/selenium/webdriver/remote/remote_connection.py",
line 399, in _request
resp = self._conn.request(method, url, body=body, headers=headers)
File "/home/joel/.local/lib/python3.6/site-packages/urllib3/request.py",
line 72, in request
**urlopen_kw)
File "/home/joel/.local/lib/python3.6/site-packages/urllib3/request.py",
line 150, in request_encode_body
return self.urlopen(method, url, **extra_kw)
File "/home/joel/.local/lib/python3.6/site-packages/urllib3/poolmanager.py",
line 323, in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
File
"/home/joel/.local/lib/python3.6/site-packages/urllib3/connectionpool.py",
line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "/home/joel/.local/lib/python3.6/site-packages/urllib3/util/retry.py",
line 367, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/home/joel/.local/lib/python3.6/site-packages/urllib3/packages/six.py",
line 685, in reraise
raise value.with_traceback(tb)
File
"/home/joel/.local/lib/python3.6/site-packages/urllib3/connectionpool.py",
line 600, in urlopen
chunked=chunked)
File
"/home/joel/.local/lib/python3.6/site-packages/urllib3/connectionpool.py",
line 384, in _make_request
six.raise_from(e, None)
File "<string>", line 2, in raise_from
File
"/home/joel/.local/lib/python3.6/site-packages/urllib3/connectionpool.py",
line 380, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse
response.begin()
File "/usr/lib/python3.6/http/client.py", line 297, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.6/http/client.py", line 266, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.',
RemoteDisconnected('Remote end closed connection without response',))
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/081c97b8-5ac2-4e52-86df-691245ff1267%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/081c97b8-5ac2-4e52-86df-691245ff1267%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.