Arkadaşlar merhaba, Selenium ile gmaile login olan bir bot geliştirdim ama bu bot aşırı derecede fazla internet, data harcıyor. Tek bir gmailin login olma işlemi 70-120 MB arası data harcanıyor. Aynı işlemi normal tarayıcıdan yaptığımda ise 5-10 MB harcanıyor, olması gerektiği gibi. Bir çözüm bulamadım, yardımcı olursanız makbule geçer.
Chromedriver Kodları :
options = webdriver.ChromeOptions()
preferences = {
"profile.default_content_settings.geolocation" : "2",
"webrtc.ip_handling_policy" : "disable_non_proxied_udp",
"intl.accept_languages": ['tr-TR', 'tr', 'en-US', 'en'],
"webrtc.multiple_routes_enabled": False,
"webrtc.nonproxied_udp_enabled" : False
}
user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36"
options.add_experimental_option("prefs", preferences)
options.add_argument("--accept-lang=tr-TR,tr,en-US,en")
options.add_argument("--lang=tr-TR,tr,en-US,en")
options.add_argument('--disable-blink-features=AutomationControlled')
options.add_argument("--disable-dev-shm-usage")
options.add_argument("--no-sandbox")
#options.add_argument('--headless=new')
options.add_argument('--ignore-certificate-errors-spki-list')
options.add_argument('--ignore-certificate-errors')
options.add_argument('--ignore-ssl-errors')
options.add_argument("--disable-impl-side-painting")
options.add_argument("--disable-setuid-sandbox")
options.add_argument("--disable-seccomp-filter-sandbox")
options.add_argument("--disable-breakpad")
options.add_argument("--disable-client-side-phishing-detection")
options.add_argument("--disable-cast")
options.add_argument("--disable-cast-streaming-hw-encoding")
options.add_argument("--disable-cloud-import")
options.add_argument("--disable-popup-blocking")
options.add_argument("--ignore-certificate-errors")
options.add_argument("--disable-session-crashed-bubble")
options.add_argument("--disable-ipv6")
options.add_argument("--allow-http-screen-capture")
options.add_argument('--profile-directory=Default')
#options.add_argument('--proxy-server=%s' % PROXY)
options.add_argument("--disable-plugins-discovery")
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
options.add_argument('--user-agent=%s' % user_agent)
options.page_load_strategy = 'none'
service = Service('./chromedriver.exe')
driver1 = webdriver.Chrome(options=options, service=service)
driver1.set_window_size(900, 900)
driver1.set_window_position(0,0)
driver1.get("https://www.google.com/intl/tr/gmail/about/")