{"action":"created","issue":{"url":"https://api.github.com/repos/ariya/phantomjs/issues/14581","repository_url":"https://api.github.com/repos/ariya/phantomjs","labels_url":"https://api.github.com/repos/ariya/phantomjs/issues/14581/labels{/name}","comments_url":"https://api.github.com/repos/ariya/phantomjs/issues/14581/comments","events_url":"https://api.github.com/repos/ariya/phantomjs/issues/14581/events","html_url":"https://github.com/ariya/phantomjs/issues/14581","id":181822976,"number":14581,"title":"phantomjs proxy catch exception","user":{"login":"ljdawn","id":4336119,"avatar_url":"https://avatars.githubusercontent.com/u/4336119?v=3","gravatar_id":"","url":"https://api.github.com/users/ljdawn","html_url":"https://github.com/ljdawn","followers_url":"https://api.github.com/users/ljdawn/followers","following_url":"https://api.github.com/users/ljdawn/following{/other_user}","gists_url":"https://api.github.com/users/ljdawn/gists{/gist_id}","starred_url":"https://api.github.com/users/ljdawn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ljdawn/subscriptions","organizations_url":"https://api.github.com/users/ljdawn/orgs","repos_url":"https://api.github.com/users/ljdawn/repos","events_url":"https://api.github.com/users/ljdawn/events{/privacy}","received_events_url":"https://api.github.com/users/ljdawn/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-10-08T12:17:08Z","updated_at":"2016-10-18T04:00:58Z","closed_at":"2016-10-09T10:36:15Z","body":"my phantomjs version is 2.1.1\r\nhere is my code \r\n```\r\nservice_args = [\r\n    '--proxy=%s' % '124.42.7.103:80',\r\n    '--proxy-type=%s' % 'https',\r\n    '--ignore-ssl-errors=true',\r\n    '--ssl-protocol=TLSv1'\r\n]\r\ndriver = webdriver.PhantomJS(service_args=service_args)\r\ndriver.implicitly_wait(TIME_WAIT)\r\nwait = WebDriverWait(driver, TIME_WAIT)\r\ndriver.get('http://www.baidu.com')\r\n```\r\nif the proxy is invalid, then driver.page_source get '<html><head></head><body></body></html>'\r\nI wanna catch the exception, Could u plz tell me how to do that ? \r\nAnd sometimes I got \r\n\"Message: {\"errorMessage\":\"Currently Window handle/name is invalid (closed?)\",\"request\":{\"headers\":{\"Accept\":\"application/json\",\"Accept-Encodin    g\":\"identity\",\"Connection\":\"close\",\"Content-Length\":\"114\",\"Content-Type\":\"application/json;charset=UTF-8\",\"Host\":\"127.0.0.1:64373\",\"User-Agent\":\"Python-urllib/2.7\"},\"httpVersi    on\":\"1.1\",\"method\":\"POST\",\"post\":\"{\\\"url\\\": \\\"http://zhushou.360.cn/detail/index/soft_id/3508760\\\", \\\"sessionId\\\": \\\"e55562e0-8d2a-11e6-a764-3330391cee5b\\\"}\",\"url\":\"/url\",\"url    Parsed\":{\"anchor\":\"\",\"query\":\"\",\"file\":\"url\",\"directory\":\"/\",\"path\":\"/url\",\"relative\":\"/url\",\"port\":\"\",\"host\":\"\",\"password\":\"\",\"user\":\"\",\"userInfo\":\"\",\"authority\":\"\",\"protocol    \":\"\",\"source\":\"/url\",\"queryKey\":\"\r\nThis should be caused by the invalid proxy, how can i fix this ?\r\n thank you "},"comment":{"url":"https://api.github.com/repos/ariya/phantomjs/issues/comments/254400770","html_url":"https://github.com/ariya/phantomjs/issues/14581#issuecomment-254400770","issue_url":"https://api.github.com/repos/ariya/phantomjs/issues/14581","id":254400770,"user":{"login":"chfyjy","id":16396851,"avatar_url":"https://avatars.githubusercontent.com/u/16396851?v=3","gravatar_id":"","url":"https://api.github.com/users/chfyjy","html_url":"https://github.com/chfyjy","followers_url":"https://api.github.com/users/chfyjy/followers","following_url":"https://api.github.com/users/chfyjy/following{/other_user}","gists_url":"https://api.github.com/users/chfyjy/gists{/gist_id}","starred_url":"https://api.github.com/users/chfyjy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chfyjy/subscriptions","organizations_url":"https://api.github.com/users/chfyjy/orgs","repos_url":"https://api.github.com/users/chfyjy/repos","events_url":"https://api.github.com/users/chfyjy/events{/privacy}","received_events_url":"https://api.github.com/users/chfyjy/received_events","type":"User","site_admin":false},"created_at":"2016-10-18T04:00:58Z","updated_at":"2016-10-18T04:00:58Z","body":"When I set proxy by this|:self.driver.capabilities[\"proxy\"] = {\"proxy\": proxyip.proxy,                                  \r\n                                         \"proxy-type\": \"http\"} \r\n\r\nto open a url address success"}}
{"actor":{"display_login":"chfyjy"}}