元ネタはこちら
- 前澤友作社長から100万円を貰うためにTwitterのフォローとリツイートを自動化する
- https://qiita.com/relu/items/d37f746c85c6494c3799
Macで失敗
- seleniumで途中まで動いたがdriver errorで死んだ
Windows Python3系で失敗
- pip install gimeiでcp932エラー
- cmdの文字コードを変えてもダメ
Windows Python2系で成功
- gimeiも入った
- lxmlで検索しているところを微修正
- .pathとtypoしている箇所を.xpathに (auth_codeの箇所)
- 検索用の文字列を実際に合わせて変更 Sign up -> 登録する
- 1周完了したのを確認したので、Windowsのタスクスケジューラでbatを定期実行
4回成功したのち、エラーが発生するようになる
- 成功していたときと表示が変わるので、HTML内の検索もうまくいかずエラー
Twitterに表示された画面
twitter Options
We've temporarily limited some of your account features
河原 果樹
@xcA4T2mV5kBq5UT
What happened?
Your account appears to have exhibited unusual behavior violating the Twitter Rules.
You can use all of Twitter's features again once you complete the following steps to confirm you are the account owner.
What next?
For full access, you must:
Pass a Google reCAPTCHA challenge
When you tap 'Start', Google may collect and use information about you,
your device, and browser. View Google's Privacy Policy.
- reCAPTCHAやって人間であることを示せとのこと
- 面倒そうなのでここで止める
プロキシー設定はしているはずだが・・・
#proxy_server='http://159.89.200.187:8080'
proxy_server='http://139.59.80.140:8000'
options.add_argument('--proxy-server=%s' % proxy_server)
学び
- 今までソシャゲのBotとか作ってこなかったが、今回のでselenium, lxml等に少し慣れた