Selenium によるブラウザの自動化

以下の例では、Selenium を使用して GoLogin を操作する方法を示します。GoLogin テクノロジを使用すると、Orbita ブラウザーを使用できます。Orbita ブラウザーでは、操り人形師を介して独自のブラウザー スナップショットを使用できます。 Selenium for work with GoLogin. GoLogin technology allows you to use the Orbita browser, where you can use the unique browser snapshots through puppeteer. By setting up profiles on the gologin.com さまざまなデバイス、プラットフォーム、画面解像度、地理位置情報、タイムゾーン、WebRTC の可用性をエミュレートし、プロキシまたは必要な国のプロキシを指定できる Web サイト。同時に、Cookie と一般的なブラウザのフィンガープリントが保存されますサイトが再認証を必要とせず、新しいブラウザをエミュレートする必要がある場合に別のコマンドで変更できるように、プロファイルに. geolocation , timezone, availability of WebRTC , specify your proxies or proxies of the required country, etc. At the same time cookies and a common browser fingerprint will be saved in the profile so that the site does not require re-authorization and it can be changed with another command if you need to emulate a new browser.

Selenium には chromedriver が必要です。GoLogin を操作するための最新バージョンは、selenium ディレクトリの github.com/gologinapp/gologin リポジトリにあります。

Python (3.8) で例を示します

完全なパーサー コードを以下に示します。要点を個別に分析します。


import time
from sys import platform
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from gologin import GoLogin


gl = GoLogin({
 'token': 'yU0token',
 'profile_id': 'yU0Pr0f1leiD',
})

if platform == "linux" or platform == "linux2":
 chrome_driver_path = './chromedriver'
elif platform == "darwin":
 chrome_driver_path = './mac/chromedriver'
elif platform == "win32":
 chrome_driver_path = 'chromedriver.exe'

debugger_address = gl.start()
chrome_options = Options()
chrome_options.add_experimental_option("debuggerAddress", debugger_address)
driver = webdriver.Chrome(executable_path=chrome_driver_path, options=chrome_options)
driver.get("http://www.python.org")
assert "Python" in driver.title
driver.close()
time.sleep(3)
gl.stop()

										

最初のステップは、GoLogin クラスのインスタンスを作成することです。そのパラメーターでは、実行するアクセス トークンとプロファイルを指定する必要があります。Orbita 実行可能ファイルは、デフォルトでユーザーのディレクトリで検索されます ( executablePath パラメーターでオーバーライドできます):


const GL = new GoLogin({
 profile_id: 'yU0Pr0f1leiD',
 token: 'yU0token',
});
										

次に、リモート ブラウザーを起動するコマンドが与えられ、リンクを受信した後、Selenium に送信されます:


debugger_address = gl.start()
chrome_options = Options()
chrome_options.add_experimental_option("debuggerAddress", debugger_address)
driver = webdriver.Chrome(executable_path=chrome_driver_path, options=chrome_options)
										

次に python.org の Web サイトにアクセスして、適切な場所に到達したことを確認してください:


driver.get("http://www.python.org")
assert "Python" in driver.title

										

作業を完了するには、ドライバーを閉じてプロファイル停止を実行します

この方法で、Selenium を GoLogin で使用できます。

BANやブロックを受けずに複数のアカウントを運用する

こちらもお読みください

最高のリモートアクセスソフトウェア

2024年版ベスト・リモートアクセスソフトウェア&ツール17選

最高のリモート・リモートアクセスソフトウェア・ツール17選をレビューしました。 あなたの具体的なニーズに合うものを見つけるために、読み進めてください。

データ入力ジョブ | データ入力演算子

データ入力ジョブ | データ入力演算子:ビギナーズガイド 2024

最高のデータ入力の仕事を探している人々は、通常、リモートワークの世界に入る方法を探しています。 柔軟な働き方を楽しめるフリーランサーを目指すなら、データ入力はそのライフスタイルを実現するために必要なスキルや専門知識を身につけるのに役立ちます。

anti fingerprint browser

2023年究極の指紋防止ブラウザ・リスト

2023年、検知防止ブラウザの選択は? 我々は、最終的な、究極のアンチデテクト市場代替品リストを作成した!