pythonとPhantomJSを用いて、あるサイトの自動ログイン処理を作成しようとしています。
Python
1br = webdriver.PhantomJS() 2url = "https://www.qupio.jp" 3br.get(url) 4#成功を確認 5br.find_element_by_id('ap_id')
上記を実行すると、要素が取得できず終了してしまいます。
save_screenshotでも何も画像が取得できていないので
レンダリングが終わっていないと思いsleepを入れてみましたが
現象は改善しませんでした。Googleのトップページは取得できたので
基本的な処理は間違っていないと思いますが、改善点ございましたらご教示お願い致します。
20180710追記)
br.find_element_by_id('ap_id')を実施後以下のようなエラーが発生しています。
おそらく存在しないidの要素を取りに行こうとして落ちているのではないかと思います。
selenium.common.exceptions.NoSuchElementException: Message: {"errorMessage":"Unable to find element with id 'ap_id'","request":{"headers":{"Accept":"application/json","Accept-Encoding":"identity","Connection":"close","Content-Length":"86","Content-Type":"application/json;charset=UTF-8","Host":"","User-Agent":"Python http auth"},"httpVersion":"1.1","method":"POST","post":"{"using": "id", "value": "ap_id", "sessionId": ""}","url":"/element","urlParsed":{"anchor":"","query":"","file":"element","directory":"/","path":"/element","relative":"/element","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/element","queryKey":{},"chunks":["element"]},"urlOriginal":""}}