2016-09-07 1 views
1

私はボットを作っていますので、Torを使いたいです。さらに、IpをGeoloactionまたはCountryを選択して設定します。これは可能ですか?Tor IPをGeoLocationに設定するにはどうすればよいですか?

相続人は私のTorはコード

public static void setUp() throws Exception { 
    //driver = new HtmlUnitDriver();  
    //driver = new FirefoxDriver(); 
    String torPath = "/Applications/TorBrowser.app/Contents/MacOS/firefox"; 
    String profilePath = "/Applications/TorBrowser.app/TorBrowser/Data/Browser/profile.default/"; 
    FirefoxProfile profile = new FirefoxProfile(new File(profilePath)); 
    FirefoxBinary binary = new FirefoxBinary(new File(torPath)); 
    driver = new FirefoxDriver(binary, profile);   
    baseUrl = "https://qa2all.wordpress.com"; 
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); 
} 

答えて

0

を初期化するあなたがしなければならないのは、(通常Browser/TorBrowser/Data/Torに位置)ブラウザバンドルで使用されるtorrc設定ファイルを編集し、そのように設定値を追加することです:

ExitNodes {US} 

ここで、USは、使用したいIPの国コードです。カンマで区切って複数指定することができます。注:作業するには、国コードを{}で囲む必要があります。受け入れられたものの詳細については、ExcludeNodesのドキュメントを参照してください。

+0

ありがとうございました。サー! –

関連する問題