以前まではPythonのseleniumを使用してbet365のサイトをスクレイピングできたのですが、突然できなくなってしましました。
FireFox自体は立ち上がるのですが、bet365のサイトだけがどうしても開きません。通常のブラウザでの起動では問題なくサイトに入れることは確認しています。デベロッパーツールのconsoleでは下記のエラーが確認出来たので、サイトからのレスポンスが変わったとかが原因なのでしょうか?
でも、通常のブラウザ起動では問題がなく,結局解決方法が分からずご質問させてもらいました。
ChromeやSafariでも同様にサイトに接続出来ませんでした。
下記実行ソースと環境とログになります。
macOS Catalina:Version 10.15.5
selenium:3.141.0
geckodriver:Version 0.26.0
Python3
1# bet365.py 2from selenium.webdriver import Firefox 3from selenium.webdriver.firefox.options import Options 4 5class Bet365Driver(object): 6 def __init__(self): 7 option = Options() 8 option.log.level = 'trace' 9 self.driver = Firefox(executable_path=settings.driver_path, options=option) 10 self.driver.get('https://www.bet365.com/') 11 12# main.py 13from bet365.bet365 import Bet365Driver 14 15if __name__ == '__main__': 16 bet365 = Bet365Driver() 17
SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
1593178290440 mozrunner::runner INFO Running command: "/Applications/Firefox.app/Contents/MacOS/firefox-bin" "-marionette" "-foreground" "-no-remote" "-profile" "/var/folders/kl/1knsq6kn0tlcqj0pgbvy9sm40000gn/T/rust_mozprofilegbOWun" 1593178290441 geckodriver::marionette DEBUG Waiting 60s to connect to browser on 127.0.0.1:54860 1593178293067 Marionette TRACE Marionette enabled 1593178293215 Marionette TRACE Received observer notification toplevel-window-ready 1593178294985 Marionette TRACE Received observer notification marionette-startup-requested 1593178294985 Marionette TRACE Waiting until startup recorder finished recording startup scripts... 1593178294996 Marionette TRACE All scripts recorded. 1593178294996 Marionette DEBUG Setting recommended pref apz.content_response_timeout to 60000 1593178294996 Marionette DEBUG Setting recommended pref browser.contentblocking.introCount to 99 1593178294996 Marionette DEBUG Setting recommended pref browser.download.panel.shown to true 1593178294996 Marionette DEBUG Setting recommended pref browser.newtabpage.enabled to false 1593178294997 Marionette DEBUG Setting recommended pref browser.pagethumbnails.capturing_disabled to true 1593178294997 Marionette DEBUG Setting recommended pref browser.search.update to false 1593178294997 Marionette DEBUG Setting recommended pref browser.tabs.disableBackgroundZombification to false 1593178294997 Marionette DEBUG Setting recommended pref browser.tabs.remote.separatePrivilegedContentProcess to false 1593178294997 Marionette DEBUG Setting recommended pref browser.tabs.unloadOnLowMemory to false 1593178294997 Marionette DEBUG Setting recommended pref browser.tabs.warnOnCloseOtherTabs to false 1593178294997 Marionette DEBUG Setting recommended pref browser.tabs.warnOnOpen to false 1593178294997 Marionette DEBUG Setting recommended pref browser.usedOnWindows10.introURL to 1593178294997 Marionette DEBUG Setting recommended pref browser.urlbar.suggest.searches to false 1593178294998 Marionette DEBUG Setting recommended pref datareporting.policy.dataSubmissionPolicyAccepted to false 1593178294998 Marionette DEBUG Setting recommended pref dom.disable_beforeunload to true 1593178294998 Marionette DEBUG Setting recommended pref dom.disable_open_during_load to false 1593178294998 Marionette DEBUG Setting recommended pref dom.file.createInChild to true 1593178294998 Marionette DEBUG Setting recommended pref dom.max_chrome_script_run_time to 0 1593178294998 Marionette DEBUG Setting recommended pref dom.max_script_run_time to 0 1593178294999 Marionette DEBUG Setting recommended pref dom.push.connection.enabled to false 1593178294999 Marionette DEBUG Setting recommended pref extensions.getAddons.cache.enabled to false 1593178294999 Marionette DEBUG Setting recommended pref extensions.getAddons.discovery.api_url to data:, 1593178294999 Marionette DEBUG Setting recommended pref network.http.prompt-temp-redirect to false 1593178294999 Marionette DEBUG Setting recommended pref privacy.trackingprotection.enabled to false 1593178294999 Marionette DEBUG Setting recommended pref security.fileuri.strict_origin_policy to false 1593178294999 Marionette DEBUG Setting recommended pref security.notification_enable_delay to 0 1593178294999 Marionette DEBUG Setting recommended pref signon.autofillForms to false 1593178295000 Marionette DEBUG Setting recommended pref signon.rememberSignons to false 1593178295000 Marionette DEBUG Setting recommended pref toolkit.cosmeticAnimations.enabled to false 1593178295028 Marionette INFO Listening on port 54860 1593178295028 Marionette DEBUG Marionette is listening 1593178295045 Marionette DEBUG Accepted connection 0 from 127.0.0.1:54922 1593178295045 geckodriver::marionette DEBUG Connection to Marionette established on 127.0.0.1:54860. 1593178295046 Marionette DEBUG 0 -> [0,1,"WebDriver:NewSession",{"acceptInsecureCerts":true,"browserName":"firefox"}] 1593178295046 Marionette WARN TLS certificate errors will be ignored for this session 1593178295060 Marionette TRACE [16] Frame script loaded 1593178295060 Marionette TRACE [16] Frame script registered 1593178295062 Marionette DEBUG 0 <- [1,1,null,{"sessionId":"3d91129a-4eaa-a84d-ad7a-b34674e9f4b0","capabilities":{"browserName":"firefox","browserVersion":"77.0. ... /rust_mozprofilegbOWun","moz:shutdownTimeout":60000,"moz:useNonSpecCompliantPointerOrigin":false,"moz:webdriverClick":true}}] 1593178295066 webdriver::server DEBUG <- 200 OK {"value":{"sessionId":"3d91129a-4eaa-a84d-ad7a-b34674e9f4b0","capabilities":{"acceptInsecureCerts":true,"browserName":"firefox","browserVersion":"77.0.1","moz:accessibilityChecks":false,"moz:buildID":"20200602222727","moz:geckodriverVersion":"0.26.0","moz:headless":false,"moz:processID":80814,"moz:profile":"/var/folders/kl/1knsq6kn0tlcqj0pgbvy9sm40000gn/T/rust_mozprofilegbOWun","moz:shutdownTimeout":60000,"moz:useNonSpecCompliantPointerOrigin":false,"moz:webdriverClick":true,"pageLoadStrategy":"normal","platformName":"mac","platformVersion":"19.5.0","rotatable":false,"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss and notify"}}} 1593178295068 webdriver::server DEBUG -> POST /session/3d91129a-4eaa-a84d-ad7a-b34674e9f4b0/url {"url": "https://www.bet365.com/"} 1593178295068 Marionette DEBUG 0 -> [0,2,"WebDriver:Navigate",{"url":"https://www.bet365.com/"}] 1593178295073 Marionette TRACE [16] Received DOM event beforeunload for about:blank 1593178295627 Marionette TRACE [16] Received DOM event pagehide for about:blank 1593178297073 Marionette TRACE [16] Received DOM event DOMContentLoaded for https://www.bet365.com/ 1593178297075 Marionette TRACE [16] Received DOM event pageshow for https://www.bet365.com/ 1593178297076 Marionette DEBUG 0 <- [1,2,null,{"value":null}] 1593178297077 webdriver::server DEBUG <- 200 OK {"value":null} 1593178297078 webdriver::server DEBUG -> POST /session/3d91129a-4eaa-a84d-ad7a-b34674e9f4b0/window/rect {"x": null, "y": null, "width": 1420, "height": 1200} 1593178297078 Marionette DEBUG 0 -> [0,3,"WebDriver:SetWindowRect",{"height":1200,"width":1420}] 1593178297130 Marionette DEBUG 0 <- [1,3,null,{"x":857,"y":109,"width":1420,"height":1200}] 1593178297133 webdriver::server DEBUG <- 200 OK {"value":{"x":857,"y":109,"width":1420,"height":1200}} 1593178297144 Marionette DEBUG Closed connection 0
回答4件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/09/27 22:22 編集
2020/09/27 22:22 編集