1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

闇のプログラミングAdvent Calendar 2023

Day 10

匿名selenimu

Last updated at Posted at 2023-12-09

torという技術

私はよくわからない。なにそれ。

torを有効にしたselenium

まず前提としてサーバでtorが動いていること。
あとは要するにseleniumで実行しようとしているブラウザのプロキシにtorのアドレスを設定する、
これはfirefoxでやる例。

spy family


    from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
    from selenium.webdriver.firefox.options import Options

    options = Options()
    options.headless = True

    profile = webdriver.FirefoxProfile()
    profile.set_preference('network.proxy.type', 1)
    profile.set_preference("network.proxy.http", "127.0.0.1")
    profile.set_preference("network.proxy.http_port", "9050")
    profile.update_preferences()

    options.add_argument('--proxy-server=socks5://localhost:9050')
    binary = FirefoxBinary('/usr/bin/firefox')

    driver = webdriver.Firefox(firefox_binary=binary, options=options , firefox_profile=profile)

そもそも

オニオンブラウザをseleniumで動かせるのかな?できない事はなさそう。torの匿名性に興味があるだけでディープウェブは興味ないからやらんけど。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?