Coder Social home page Coder Social logo

coskundeniz / ad_clicker Goto Github PK

View Code? Open in Web Editor NEW
131.0 10.0 57.0 13.21 MB

Google Ads clicker

Home Page: https://coskundeniz.github.io/ad_clicker/

License: GNU General Public License v3.0

Python 98.50% Dockerfile 1.50%
google-ads python tor selenium search undetected-chromedriver multiprocessing rotating-proxy bing-ads

ad_clicker's Issues

run_ad_clicker.py issues

Hi!
If I use the "basic" ad_clicker.py everything is working fine.
For example:

python ad_clicker.py -q "test" -t 15
python ad_clicker.py -q "test@domain1#domain2#domain3" -t 15

When I try to automize the script using run_ad_clicker.py nothing works.
For example, if I use this command on Windows:

py run_ad_clicker.py -qf queries.txt -pf proxies.txt

As you can see in the screenshot below, the script generate a lot of errors and nothing works

Error2

This is the content of "queries.txt":

"test@name1#name2#name3"
"test2@name1#name2#name3"

Tor search is being blocked by google.com

First of all everything is working as expected but i think you missed a point
Whenever selenium action triggered by tor proxy to open the google.com and then make the search function, everything is going through tor nodes so google naturally blocks search function with catpcha for tor node ips. Actually there is a way to bypass this like in the embedded opera vpn which disables vpn for google.com and allows the user to make the search and then during the visiting/clicking function, the vpn is activated. I am trying to find a solution as modifying the codes and will send you a pull request if i can achieve it. But do you have an idea about how to do that?

Press fix issue

How to fix it

19-10-2023 20:32:45 <<1>> [ERROR] 204: Couldn't find latitude and longitude for 203.19.38.114! Retrying after 5 seconds...
19-10-2023 20:32:56 <<1>> [ERROR] 204: Couldn't find latitude and longitude for 203.19.38.114! Retrying after 10 seconds...
19-10-2023 20:33:21 <<1>> [ERROR] 204: Couldn't find latitude and longitude for 203.19.38.114! Retrying after 20 seconds...
19-10-2023 20:33:56 <<1>> [ERROR] 204: Couldn't find latitude and longitude for 203.19.38.114! Retrying after 40 seconds...
19-10-2023 20:34:51 <<1>> [ERROR] 204: Couldn't find latitude and longitude for 203.19.38.114! Retrying after 80 seconds...

image

Multi Browser not working

(env) PS C:\Users\Administrator\Desktop\ad_clicker-main> py ad_clicker.py -q "wireless keyboard"
01-03-2023 16:11:30 [ INFO] 58: Starting search for 'wireless keyboard'
01-03-2023 16:11:35 [ INFO] 76: Getting ad links...
01-03-2023 16:14:16 [ INFO] 192: ======= Found an Ad =======
01-03-2023 16:14:16 [ INFO] 192: ======= Found an Ad =======
01-03-2023 16:14:16 [ INFO] 192: ======= Found an Ad =======
01-03-2023 16:14:16 [ INFO] 192: ======= Found an Ad =======
01-03-2023 16:14:16 [ INFO] 192: ======= Found an Ad =======
01-03-2023 16:14:16 [ INFO] 85: Found 5 ads
01-03-2023 16:14:16 [ INFO] 99: Clicking to Wireless Keyboards on Amazon - Low Priced Wireless Keyboards...
01-03-2023 16:14:21 [ INFO] 99: Clicking to Washable & Waterproof Keyboards – Seal Shield...
01-03-2023 16:14:26 [ INFO] 99: Clicking to Keyboards...
01-03-2023 16:14:31 [ INFO] 99: Clicking to Wireless Keyboard at Amazon® - Amazon Official Site...
01-03-2023 16:14:37 [ INFO] 99: Clicking to Shop Keyboard & Mouse - For PC, Laptop, Multi Devices...
(env) PS C:\Users\Administrator\Desktop\ad_clicker-main> py run_ad_clicker.py -qf \Users\Administrator\Desktop\ad_clicker-main/queries.txt -pf \Users\Administrator\Desktop\ad_clicker-main/proxies.txt -ms 2
01-03-2023 16:18:21 <<2>> [ INFO] 218: Using proxy: 'reveriespotter0m:D66bVoCXVy:204.242.180.208:49036'
01-03-2023 16:18:21 <<1>> [ INFO] 218: Using proxy: 'reveriespotter0m:D66bVoCXVy:204.242.180.208:49036'
01-03-2023 16:18:21 <<4>> [ INFO] 218: Using proxy: 'reveriespotter0m:D66bVoCXVy:204.242.180.208:49036'
01-03-2023 16:18:21 <<3>> [ INFO] 218: Using proxy: 'reveriespotter0m:D66bVoCXVy:204.242.180.208:49036'
01-03-2023 16:18:24 <<2>> [ INFO] 81: Connecting with IP: 'reveriespotter0m
01-03-2023 16:18:24 <<2>> [ERROR] 119: Expecting value: line 4 column 1 (char 3)
01-03-2023 16:18:24 <<4>> [ INFO] 81: Connecting with IP: 'reveriespotter0m
01-03-2023 16:18:24 <<3>> [ INFO] 81: Connecting with IP: 'reveriespotter0m
01-03-2023 16:18:24 <<4>> [ERROR] 119: Expecting value: line 4 column 1 (char 3)
01-03-2023 16:18:24 <<3>> [ERROR] 119: Expecting value: line 4 column 1 (char 3)
01-03-2023 16:18:25 <<1>> [ INFO] 81: Connecting with IP: 'reveriespotter0m
01-03-2023 16:18:25 <<1>> [ERROR] 119: Expecting value: line 4 column 1 (char 3)
01-03-2023 16:18:25 <<2>> [ERROR] 119: Expecting value: line 4 column 1 (char 3)
01-03-2023 16:18:26 <<4>> [ERROR] 119: Expecting value: line 4 column 1 (char 3)
01-03-2023 16:18:26 <<3>> [ERROR] 119: Expecting value: line 4 column 1 (char 3)
01-03-2023 16:18:26 <<1>> [ERROR] 119: Expecting value: line 4 column 1 (char 3)
01-03-2023 16:18:26 <<2>> [ERROR] 119: Expecting value: line 4 column 1 (char 3)
01-03-2023 16:18:27 <<4>> [ERROR] 119: Expecting value: line 4 column 1 (char 3)
01-03-2023 16:18:27 <<3>> [ERROR] 119: Expecting value: line 4 column 1 (char 3)
01-03-2023 16:18:27 <<1>> [ERROR] 119: Expecting value: line 4 column 1 (char 3)
01-03-2023 16:18:27 <<2>> [ERROR] 119: Expecting value: line 4 column 1 (char 3)
01-03-2023 16:18:28 <<4>> [ERROR] 119: Expecting value: line 4 column 1 (char 3)
01-03-2023 16:18:28 <<3>> [ERROR] 119: Expecting value: line 4 column 1 (char 3)
01-03-2023 16:18:28 <<1>> [ERROR] 119: Expecting value: line 4 column 1 (char 3)
01-03-2023 16:18:29 <<4>> [ERROR] 119: Expecting value: line 4 column 1 (char 3)
01-03-2023 16:18:29 <<2>> [ERROR] 119: Expecting value: line 4 column 1 (char 3)
01-03-2023 16:18:29 <<3>> [ERROR] 119: Expecting value: line 4 column 1 (char 3)
01-03-2023 16:18:29 <<1>> [ERROR] 119: Expecting value: line 4 column 1 (char 3)
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\ad_clicker-main\ad_clicker.py", line 92, in
main()
File "C:\Users\Administrator\Desktop\ad_clicker-main\ad_clicker.py", line 77, in main
driver = create_webdriver(proxy, args.auth, args.headless)
File "C:\Users\Administrator\Desktop\ad_clicker-main\utils.py", line 243, in create_webdriver
lat, long = get_location(geolocation_db_client, proxy, auth)
File "C:\Users\Administrator\Desktop\ad_clicker-main\utils.py", line 128, in get_location
if not (latitude or longitude):
UnboundLocalError: local variable 'latitude' referenced before assignment
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\ad_clicker-main\ad_clicker.py", line 92, in
main()
File "C:\Users\Administrator\Desktop\ad_clicker-main\ad_clicker.py", line 77, in main
driver = create_webdriver(proxy, args.auth, args.headless)
File "C:\Users\Administrator\Desktop\ad_clicker-main\utils.py", line 243, in create_webdriver
lat, long = get_location(geolocation_db_client, proxy, auth)
File "C:\Users\Administrator\Desktop\ad_clicker-main\utils.py", line 128, in get_location
if not (latitude or longitude):
UnboundLocalError: local variable 'latitude' referenced before assignment
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\ad_clicker-main\ad_clicker.py", line 92, in
main()
File "C:\Users\Administrator\Desktop\ad_clicker-main\ad_clicker.py", line 77, in main
driver = create_webdriver(proxy, args.auth, args.headless)
File "C:\Users\Administrator\Desktop\ad_clicker-main\utils.py", line 243, in create_webdriver
lat, long = get_location(geolocation_db_client, proxy, auth)
File "C:\Users\Administrator\Desktop\ad_clicker-main\utils.py", line 128, in get_location
if not (latitude or longitude):
UnboundLocalError: local variable 'latitude' referenced before assignment
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\ad_clicker-main\ad_clicker.py", line 92, in
main()
File "C:\Users\Administrator\Desktop\ad_clicker-main\ad_clicker.py", line 77, in main
driver = create_webdriver(proxy, args.auth, args.headless)
File "C:\Users\Administrator\Desktop\ad_clicker-main\utils.py", line 243, in create_webdriver
lat, long = get_location(geolocation_db_client, proxy, auth)
File "C:\Users\Administrator\Desktop\ad_clicker-main\utils.py", line 128, in get_location
if not (latitude or longitude):
UnboundLocalError: local variable 'latitude' referenced before assignment

cannot connect to chrome - some of the time

about 4 of 5 times running ad_clicker i get the attached error.
1/5 no problem and it does what its supposed to.
I run poetry run python ad_clicker.py -q "dogfood" -t 5 --headless
its locally installed using git clone and up to date, running on Mac M2.

Traceback (most recent call last):
  File "/Users/finn/code/ad_clicker/ad_clicker.py", line 150, in <module>
    main()
  File "/Users/finn/code/ad_clicker/ad_clicker.py", line 122, in main
    driver = create_webdriver(proxy, args.auth, args.headless, args.incognito)
  File "/Users/finn/code/ad_clicker/utils.py", line 340, in create_webdriver
    driver = undetected_chromedriver.Chrome(
  File "/Users/finn/Library/Caches/pypoetry/virtualenvs/ad-clicker-s-_YzNe_-py3.10/lib/python3.10/site-packages/undetected_chromedriver/__init__.py", line 466, in __init__
    super(Chrome, self).__init__(
  File "/Users/finn/Library/Caches/pypoetry/virtualenvs/ad-clicker-s-_YzNe_-py3.10/lib/python3.10/site-packages/selenium/webdriver/chrome/webdriver.py", line 84, in __init__
    super().__init__(
  File "/Users/finn/Library/Caches/pypoetry/virtualenvs/ad-clicker-s-_YzNe_-py3.10/lib/python3.10/site-packages/selenium/webdriver/chromium/webdriver.py", line 104, in __init__
    super().__init__(
  File "/Users/finn/Library/Caches/pypoetry/virtualenvs/ad-clicker-s-_YzNe_-py3.10/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 286, in __init__
    self.start_session(capabilities, browser_profile)
  File "/Users/finn/Library/Caches/pypoetry/virtualenvs/ad-clicker-s-_YzNe_-py3.10/lib/python3.10/site-packages/undetected_chromedriver/__init__.py", line 724, in start_session
    super(selenium.webdriver.chrome.webdriver.WebDriver, self).start_session(
  File "/Users/finn/Library/Caches/pypoetry/virtualenvs/ad-clicker-s-_YzNe_-py3.10/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 378, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/Users/finn/Library/Caches/pypoetry/virtualenvs/ad-clicker-s-_YzNe_-py3.10/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 440, in execute
    self.error_handler.check_response(response)
  File "/Users/finn/Library/Caches/pypoetry/virtualenvs/ad-clicker-s-_YzNe_-py3.10/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py", line 245, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:54572
from chrome not reachable
Stacktrace:
0   undetected_chromedriver             0x0000000100ceed28 undetected_chromedriver + 4795688
1   undetected_chromedriver             0x0000000100ce62b3 undetected_chromedriver + 4760243
2   undetected_chromedriver             0x00000001008bf6bd undetected_chromedriver + 407229
3   undetected_chromedriver             0x00000001008a94ba undetected_chromedriver + 316602
4   undetected_chromedriver             0x00000001008fc0b3 undetected_chromedriver + 655539
5   undetected_chromedriver             0x00000001008f2dd7 undetected_chromedriver + 617943
6   undetected_chromedriver             0x000000010093fafb undetected_chromedriver + 932603
7   undetected_chromedriver             0x0000000100935a73 undetected_chromedriver + 891507
8   undetected_chromedriver             0x0000000100900143 undetected_chromedriver + 672067
9   undetected_chromedriver             0x000000010090131e undetected_chromedriver + 676638
10  undetected_chromedriver             0x0000000100caf795 undetected_chromedriver + 4536213
11  undetected_chromedriver             0x0000000100cb4853 undetected_chromedriver + 4556883
12  undetected_chromedriver             0x0000000100c95001 undetected_chromedriver + 4427777
13  undetected_chromedriver             0x0000000100cb559d undetected_chromedriver + 4560285
14  undetected_chromedriver             0x0000000100c8648c undetected_chromedriver + 4367500
15  undetected_chromedriver             0x0000000100cd50e8 undetected_chromedriver + 4690152
16  undetected_chromedriver             0x0000000100cd529e undetected_chromedriver + 4690590
17  undetected_chromedriver             0x0000000100ce5eee undetected_chromedriver + 4759278
18  libsystem_pthread.dylib             0x00007ff80bcd31d3 _pthread_start + 125
19  libsystem_pthread.dylib             0x00007ff80bccebd3 thread_start + 15

[WinError 10061] No connection could be made because the target machine actively refused it

Thank you for putting this out, I was able to configure this code but I get the following error.

`
Enter tor password:
26-08-2022 14:36:07 [ INFO] 20: Changing ip address...
Traceback (most recent call last):
File "C:\Users\JS\Desktop\Traffic-Bot\env\lib\site-packages\stem\socket.py", line 535, in _make_socket
control_socket.connect((self.address, self.port))
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\JS\Desktop\Traffic-Bot\ad_clicker\ad_clicker.py", line 76, in
main()
File "C:\Users\JS\Desktop\Traffic-Bot\ad_clicker\ad_clicker.py", line 58, in main
change_ip_address(password)
File "C:\Users\JS\Desktop\Traffic-Bot\ad_clicker\ad_clicker.py", line 21, in change_ip_address
with Controller.from_port(port=9051) as controller:
File "C:\Users\JS\Desktop\Traffic-Bot\env\lib\site-packages\stem\control.py", line 1033, in from_port
control_port = stem.socket.ControlPort(address, port)
File "C:\Users\JS\Desktop\Traffic-Bot\env\lib\site-packages\stem\socket.py", line 503, in init
self.connect()
File "C:\Users\JS\Desktop\Traffic-Bot\env\lib\site-packages\stem\socket.py", line 172, in connect
self._socket = self._make_socket()
File "C:\Users\JS\Desktop\Traffic-Bot\env\lib\site-packages\stem\socket.py", line 538, in _make_socket
raise stem.SocketError(exc)
stem.SocketError: [WinError 10061] No connection could be made because the target machine actively refused it
(env)
JS@Udemezue MINGW64 ~/Desktop/Traffic-Bot/ad_clicker (main)
$ python ad_clicker.py -q "how to get started in tech with no experience" -b chrome -t 3000
Enter tor password:
26-08-2022 14:36:19 [ INFO] 20: Changing ip address...
Traceback (most recent call last):
File "C:\Users\JS\Desktop\Traffic-Bot\env\lib\site-packages\stem\socket.py", line 535, in _make_socket
control_socket.connect((self.address, self.port))
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\JS\Desktop\Traffic-Bot\ad_clicker\ad_clicker.py", line 76, in
main()
File "C:\Users\JS\Desktop\Traffic-Bot\ad_clicker\ad_clicker.py", line 58, in main
change_ip_address(password)
File "C:\Users\JS\Desktop\Traffic-Bot\ad_clicker\ad_clicker.py", line 21, in change_ip_address
with Controller.from_port(port=9051) as controller:
File "C:\Users\JS\Desktop\Traffic-Bot\env\lib\site-packages\stem\control.py", line 1033, in from_port
control_port = stem.socket.ControlPort(address, port)
File "C:\Users\JS\Desktop\Traffic-Bot\env\lib\site-packages\stem\socket.py", line 503, in init
self.connect()
File "C:\Users\JS\Desktop\Traffic-Bot\env\lib\site-packages\stem\socket.py", line 172, in connect
self._socket = self._make_socket()
File "C:\Users\JS\Desktop\Traffic-Bot\env\lib\site-packages\stem\socket.py", line 538, in _make_socket
raise stem.SocketError(exc)
stem.SocketError: [WinError 10061] No connection could be made because the target machine actively refused it
(env)
JS@Udemezue MINGW64 ~/Desktop/Traffic-Bot/ad_clicker (main)
$ python ad_clicker.py -q "how to get started in tech with no experience" -b chrome -t 3000
Enter tor password:
26-08-2022 14:36:56 [ INFO] 20: Changing ip address...
Traceback (most recent call last):
File "C:\Users\JS\Desktop\Traffic-Bot\env\lib\site-packages\stem\socket.py", line 535, in _make_socket
control_socket.connect((self.address, self.port))
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\JS\Desktop\Traffic-Bot\ad_clicker\ad_clicker.py", line 76, in
main()
File "C:\Users\JS\Desktop\Traffic-Bot\ad_clicker\ad_clicker.py", line 58, in main
change_ip_address(password)
File "C:\Users\JS\Desktop\Traffic-Bot\ad_clicker\ad_clicker.py", line 21, in change_ip_address
with Controller.from_port(port=9051) as controller:
File "C:\Users\JS\Desktop\Traffic-Bot\env\lib\site-packages\stem\control.py", line 1033, in from_port
control_port = stem.socket.ControlPort(address, port)
File "C:\Users\JS\Desktop\Traffic-Bot\env\lib\site-packages\stem\socket.py", line 503, in init
self.connect()
File "C:\Users\JS\Desktop\Traffic-Bot\env\lib\site-packages\stem\socket.py", line 172, in connect
self._socket = self._make_socket()
File "C:\Users\JS\Desktop\Traffic-Bot\env\lib\site-packages\stem\socket.py", line 538, in _make_socket
raise stem.SocketError(exc)
stem.SocketError: [WinError 10061] No connection could be made because the target machine actively refused it
`

error in line 6 proxy.py

When trying to run a test it throws me this error
(env) (root) D:\Descargas\ad_clicker-main (1)\ad_clicker-main>python ad_clicker.py -q "wireless keyboard" -pf ~/proxies.txt Traceback (most recent call last): File "ad_clicker.py", line 5, in <module> from proxy import get_proxies File "D:\Descargas\ad_clicker-main (1)\ad_clicker-main\proxy.py", line 6, in <module> def get_proxies(proxy_file: Path) -> list[str]: TypeError: 'type' object is not subscriptable

My python version 3.9.5

[ERROR] 163: Expecting value: line 4 column 1 (char 3)

Running this command:

python run_ad_clicker.py -qf queries.txt -pf proxies.txt -ms 1

Or also:

python run_ad_clicker.py -qf queries.txt -pf proxies.txt

The script seems to fail to interact with the browser

2022-12-27_131854

Also, checking "What is my IP" inside opened browser, the proxy doesn't work (as I can see my real IP)

Connection refused

File "/usr/local/lib/python3.10/dist-packages/stem/socket.py", line 535, in _make_socket
    control_socket.connect((self.address, self.port))
ConnectionRefusedError: [Errno 111] Connection refused

Merhabalar,

Ubuntuda yukarıdaki hatayı alıyorum.

Python 3.10.4

All clicks are marked as invalid (ad_clicker is now detected)

Hi guys,

All clicks made by the current build of ad clicker are free, they are marked as invalid clicks in the Google Ads backend.
Google is detecting the clicks and disregard them.

Tried 5+ different residential proxy providers.

Any idea how Google are able to detect ad_clicker?

Proxy list

First of all thanks for the amazing project.
I have a little question. Which proxy list is recommended? Any free ones available which are undetected by Google?

Error on Windows 11

Hi,
thanks for this great clicker.
I tried to use it on Windows 11, but as you can see, there are some issues.
I follow the instruction for "Windows install", and also I installaed visual-cpp-build-tools

image

Thanks

Chrome crash after first ad click

Hello!!

First of all, thank you for your effort. Project is amazing.

It's collection the ad links, when it starts after the first website, it's trying to turn back and it's crashing.

M1 Pro - Chrome 113 - Python 3.8.9 - Mac OS X. Also sharing the error log and screenshot.

Best regards.

Screen_Shot_2023-05-16_at_01 55 34
16-05-2023 01:54:52 [ INFO]  68: Starting search for 'Car for sale germany'
16-05-2023 01:54:55 [ INFO]  90: Getting ad links...
16-05-2023 01:55:19 [ INFO] 221: =====
<img width="1175" alt="Screen_Shot_2023-05-16_at_01 55 34" src="https://github.com/coskundeniz/ad_clicker/assets/121172311/f14dc7d5-63ee-4fc5-94bd-2362e2a54c02">
== Found an Ad =======
16-05-2023 01:55:19 [ INFO] 221: ======= Found an Ad =======
16-05-2023 01:55:19 [ INFO]  91: Found 1 ads
16-05-2023 01:55:19 [ INFO] 113: Clicking to [Mein Auto verkaufen - Beste Angebote für Autokauf](https://www.auto-eggert.com/fahrzeug/inzahlungnahme-rechner/)...
Traceback (most recent call last):
  File "ad_clicker.py", line 98, in <module>
    main()
  File "ad_clicker.py", line 92, in main
    search_controller.click_ads(ads)
  File "/Users/rabadon/Developer/lab/ad_clicker/search_controller.py", line 130, in click_ads
    self._driver.execute_script("arguments[0].scrollIntoView(true);", ad_link_element)
  File "/Users/rabadon/Developer/lab/ad_clicker/env/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 492, in execute_script
    return self.execute(command, {
  File "/Users/rabadon/Developer/lab/ad_clicker/env/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 429, in execute
    self.error_handler.check_response(response)
  File "/Users/rabadon/Developer/lab/ad_clicker/env/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 243, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: stale element not found
  (Session info: chrome=113.0.5672.92```

captcha google

Hello Deniz..
That posible to add captcha solver on your bot?
for example using 2captcha api to solved it

the problem with type tuple

(env) root@e86cd3ba226b:~/ad_clicker# python ad_clicker.py -q "byy3"
Traceback (most recent call last):
File "ad_clicker.py", line 4, in
from search_controller import SearchController
File "/root/ad_clicker/search_controller.py", line 18, in
AdList = list[tuple[selenium.webdriver.remote.webelement.WebElement, int]]
TypeError: 'type' object is not subscriptable

lock on language selection and acceptance of terms

The first time the browser window is opened, the language selector appears and stays there without completing any other action. Below the language selector, the acceptance of the default browser terms appears in any incognito window.
After a few seconds without action, it closes and returns a message that no results were found.

Errors when using Proxys

Hi,

Really cool python stuff you got here. Apologies before hand if this is a noobier question, but im getting this error when using proxies. It looks like its having trouble connecting and I'm not sure where to go. I saw another user was having issues with it being in incognito mode so I removed it from my command line, but still no luck.


PS C:\Users\Small Coffee Cup\Documents\ad_clicker> python ad_clicker.py -q "wireless keyboard" --auth -p 171718:[email protected]:8800 -e "amazon"

03-05-2023 16:11:43 [ INFO] 241: Using proxy: 171718:[email protected]:8800
Traceback (most recent call last):
File "C:\Users\Small Coffee Cup\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connection.py", line 174, in _new_conn
conn = connection.create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Small Coffee Cup\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\util\connection.py", line 95, in create_connection
raise err
File "C:\Users\Small Coffee Cup\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\util\connection.py", line 85, in create_connection
sock.connect(sa)
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection
failed because connected host has failed to respond

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Small Coffee Cup\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connectionpool.py", line 700, in urlopen
self._prepare_proxy(conn)
File "C:\Users\Small Coffee Cup\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connectionpool.py", line 996, in _prepare_proxy
conn.connect()
File "C:\Users\Small Coffee Cup\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connection.py", line 363, in connect
self.sock = conn = self._new_conn()
^^^^^^^^^^^^^^^^
File "C:\Users\Small Coffee Cup\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connection.py", line 179, in _new_conn
raise ConnectTimeoutError(
urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x0000023D3E53BF50>, 'Connection to 154.9.35.212 timed out. (connect timeout=None)')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Small Coffee Cup\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\adapters.py", line 487, in send
resp = conn.urlopen(
^^^^^^^^^^^^^
File "C:\Users\Small Coffee Cup\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connectionpool.py", line 787, in urlopen
retries = retries.increment(
^^^^^^^^^^^^^^^^^^
File "C:\Users\Small Coffee Cup\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\util\retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ipv4.webshare.io', port=443): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x0000023D3E53BF50>, 'Connection to 154.9.35.212 timed out. (connect timeout=None)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Small Coffee Cup\Documents\ad_clicker\ad_clicker.py", line 98, in
main()
File "C:\Users\Small Coffee Cup\Documents\ad_clicker\ad_clicker.py", line 83, in main
driver = create_webdriver(proxy, args.auth, args.headless, args.incognito)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Small Coffee Cup\Documents\ad_clicker\utils.py", line 266, in create_webdriver
lat, long = get_location(geolocation_db_client, proxy, auth)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Small Coffee Cup\Documents\ad_clicker\utils.py", line 72, in get_location
response = requests.get(
^^^^^^^^^^^^^
File "C:\Users\Small Coffee Cup\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\api.py", line 73, in get
return request("get", url, params=params, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Small Coffee Cup\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Small Coffee Cup\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Small Coffee Cup\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Small Coffee Cup\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\adapters.py", line 508, in send
raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ipv4.webshare.io', port=443): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x0000023D3E53BF50>, 'Connection to 154.9.35.212 timed out. (connect timeout=None)'))
Exception ignored in: <function Chrome.del at 0x0000023D3F4176A0>

Traceback (most recent call last):
File "C:\Users\Small Coffee Cup\AppData\Local\Programs\Python\Python311\Lib\site-packages\undetected_chromedriver_init_.py", line 788, in del
File "C:\Users\Small Coffee Cup\AppData\Local\Programs\Python\Python311\Lib\site-packages\undetected_chromedriver_init_.py", line 743, in quit
OSError: [WinError 6] The handle is invalid

Geolocation Permission

I want to Allow Location Permissions so it will take the latitude and longitude from the proxy. I have tried different settings, but the popup to Allow or Block the Permissions is still showing in chrome. Do you know any way to Allow it by default? This is what I am using now, but is not working:

driver.execute_cdp_cmd(
    "Browser.grantPermissions",
    {
      "origin": "https://www.google.com",
      "permissions": ["geolocation"]
    },
)

getting this issue

Screenshot (15)
root@vibot:/ad_clicker# python ad_clicker.py -q "wireless key" [-b browser] [-t ad_visit_time_in_seconds]
File "ad_clicker.py", line 61
logger.info(f"Connecting with IP: {response.json()['ip']}")
^
SyntaxError: invalid syntax
root@vibot:
/ad_clicker# python ad_clicker.py -q "wireless key"
File "ad_clicker.py", line 61
logger.info(f"Connecting with IP: {response.json()['ip']}")
^
SyntaxError: invalid syntax
root@vibot:~/ad_clicker#

Problem with clicking on phone ads

I have tried multiple times, but I have noticed that call-only ads (phone) ads click is not working, and I couldn't solve this issue. Do you have a chance to release an update for this, or how can I resolve it?
Also, I am using it in run in loop mode, and I think all the processes are slow. Is there a way to speed up this?

Mobile accept cookies not works

Hi,

I appreciate your works, there is a issue if have a mobile useragent , is stopped on the cookies accept, can you please fix this

thanks

startup without proxy in multi, queue

Hi

multi multi and query queue all kinds of proxy wants all kinds of proxy I tried to remove it directly anyway, it says it is starting, it closes, it does not open in any way, I want to open the multi file without proxy

The localization used is not the same as the proxies I use

Hi! I hope you're well, I have an issue : I bought French proxies on WebShare (154.194.8.125 for example), but the program locates me in New York. The interface is in French though.

image
image
image

I've tried all sorts of things: hard-coding the latitude and longitude in the code, fiddling with a few parameters, but nothing works...

image
image

I'm not sure what to try, do you have any ideas?
Thank you :)

Ignore a certain domain

Hello, is there any way to ignore a certain domain? The excluded domain should not be clicked

TypeError: WebDriver.__init__() got an unexpected keyword argument 'executable_path'

If i use ad_clicker.py with manual args - everything works. but if i use run_ad_clicker.py, i see that error:
TypeError: WebDriver.init() got an unexpected keyword argument 'executable_path'
even if use -bc 1, the error keeps appearing

Traceback (most recent call last):
File "C:\Users\User2\Desktop\test\ad_clicker.py", line 153, in
main()
File "C:\Users\User2\Desktop\test\ad_clicker.py", line 122, in main
driver = create_webdriver(proxy, args.auth, args.headless, args.incognito)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User2\Desktop\test\utils.py", line 362, in create_webdriver
driver = undetected_chromedriver.Chrome(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User2\AppData\Local\Programs\Python\Python311\Lib\site-packages\undetected_chromedriver_init_.py", line 441, in init
super(Chrome, self).init(
TypeError: WebDriver.init() got an unexpected keyword argument 'executable_path'

Google sometimes serves a legacy page meant for bots and/or old browsers - this breaks the search controller and results in a TimeoutException.

In certain circumstances, Google serves an older search page without the appbar element. I have no clue what triggers it but I've managed to get it to appear consistently on Oracle Cloud Infrastructure IPs, even with desktop user agents.

The issue with this page is that even though ads might still appear and may be treated legitimately as this page is served to older browsers like IE11, utils.py is instructed to look for an element that is not present. This results in a TimeoutException, even if the page is fully loaded and ads are present.

Attached is a stacktrace that I spawned manually after the timeout error, and what the legacy search page looks like.

The two sites are certainly structured differently with different class names but I don't doubt that it should be trivial to figure out where the ads are on the legacy page, if google does decide to serve me some since my adblocker is off.

Traceback (most recent call last):
  File "/home/ubuntu/ad_clicker/search_controller.py", line 74, in search_for_ads
    results_loaded = wait.until(EC.visibility_of_element_located(self.RESULTS_CONTAINER))
  File "/home/ubuntu/.local/lib/python3.10/site-packages/selenium/webdriver/support/wait.py", line 90, in until
    raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:
Stacktrace:
#0 0x55d55f4fa2a3 <unknown>
#1 0x55d55f2b8f77 <unknown>
#2 0x55d55f2f580c <unknown>
#3 0x55d55f2f5a71 <unknown>
#4 0x55d55f32f734 <unknown>
#5 0x55d55f315b5d <unknown>
#6 0x55d55f32d47c <unknown>
#7 0x55d55f315903 <unknown>
#8 0x55d55f2e8ece <unknown>
#9 0x55d55f2e9fde <unknown>
#10 0x55d55f54a63e <unknown>
#11 0x55d55f54db79 <unknown>
#12 0x55d55f53089e <unknown>
#13 0x55d55f54ea83 <unknown>
#14 0x55d55f523505 <unknown>
#15 0x55d55f56fca8 <unknown>
#16 0x55d55f56fe36 <unknown>
#17 0x55d55f58b333 <unknown>
#18 0x7f697f916b43 <unknown>

18-02-2023 16:00:08 [ INFO]  83: No ads in the search results!

image

error cannot use it.

Hi can you please put a step by step instructions on how to install it I have trouble installing it.
this is that I have as an error:

(ad_clicker) name@ubuntu-linux:~$ python ad_clicker/ad_clicker.py -q "keyword"
Traceback (most recent call last):
  File "ad_clicker/ad_clicker.py", line 5, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'

Thanks for making a step my step and Thanks for helping me.

Error when proxy option is used

Hello,
when I try to use -p or -pf options with some IPs, I get the following error:

(env) C:\wamp64\www\ad_clicker-main>python ad_clicker.py -q "MY QUERY" -e "MY QUERY EXCEPTIONS" -pf proxies.txt
31-05-2023 10:08:59 [ INFO] 241: Using proxy: 82.147.128:80
31-05-2023 10:09:02 [ INFO]  81: Connecting with IP: 82.147.128
31-05-2023 10:09:11 [ INFO]  67: Starting search for 'MY QUERY'
Traceback (most recent call last):
  File "C:\wamp64\www\ad_clicker-main\ad_clicker.py", line 98, in <module>
    main()
  File "C:\wamp64\www\ad_clicker-main\ad_clicker.py", line 86, in main
    ads = search_controller.search_for_ads()
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\wamp64\www\ad_clicker-main\search_controller.py", line 70, in search_for_ads
    search_input_box = self._driver.find_element(*self.SEARCH_INPUT)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\wamp64\www\ad_clicker-main\env\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 831, in find_element
    return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\wamp64\www\ad_clicker-main\env\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 440, in execute
    self.error_handler.check_response(response)
  File "C:\wamp64\www\ad_clicker-main\env\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 245, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"[name="q"]"}
  (Session info: chrome=113.0.5672.127)
Stacktrace:
Backtrace:
        GetHandleVerifier [0x007C8893+48451]
        (No symbol) [0x0075B8A1]
        (No symbol) [0x00665058]
        (No symbol) [0x00690467]
        (No symbol) [0x0069069B]
        (No symbol) [0x006BDD92]
        (No symbol) [0x006AA304]
        (No symbol) [0x006BC482]
        (No symbol) [0x006AA0B6]
        (No symbol) [0x00687E08]
        (No symbol) [0x00688F2D]
        GetHandleVerifier [0x00A28E3A+2540266]
        GetHandleVerifier [0x00A68959+2801161]
        GetHandleVerifier [0x00A6295C+2776588]
        GetHandleVerifier [0x00852280+612144]
        (No symbol) [0x00764F6C]
        (No symbol) [0x007611D8]
        (No symbol) [0x007612BB]
        (No symbol) [0x00754857]
        BaseThreadInitThunk [0x770500C9+25]
        RtlGetAppContainerNamedObjectPath [0x77B17B4E+286]
        RtlGetAppContainerNamedObjectPath [0x77B17B1E+238]

Exception ignored in: <function Chrome.__del__ at 0x000002784CCDD940>
Traceback (most recent call last):
  File "C:\wamp64\www\ad_clicker-main\env\Lib\site-packages\undetected_chromedriver\__init__.py", line 800, in __del__
  File "C:\wamp64\www\ad_clicker-main\env\Lib\site-packages\undetected_chromedriver\__init__.py", line 755, in quit
OSError: [WinError 6] The handle is invalid

(env) C:\wamp64\www\ad_clicker-main>

Using the Run_in_loop - Cant find files

Hi!

I am having an issue when using the "run in loop function". It says my there is no such file in the directory when it clearly is.

PS C:\Users\Small Coffee\Documents\ad_clicker> python run_in_loop.py -qf queries.txt -pf proxies2.txt --auth
26-05-2023 15:45:48 [ INFO] 98: Running with 8 browsers...
python: can't open file 'C:\Users\SCC': [Errno 2] No such file or directory
python: can't open file 'C:\Users\SCC': [Errno 2] No such file or directory
python: can't open file 'C:\Users\SCC': [Errno 2] No such file or directory
python: can't open file 'C:\Users\SCC': [Errno 2] No such file or directory
python: can't open file 'C:\Users\SCC': [Errno 2] No such file or directory
python: can't open file 'C:\Users\SCC': [Errno 2] No such file or directory
python: can't open file 'C:\Users\SCC': [Errno 2] No such file or directory
python: can't open file 'C:\Users\SCC': [Errno 2] No such file or directory

What is interesting is the command below will run no problem, so it looks like it is having trouble locating the queries file, but it is in the directory folder.

PS C:\Users\Small Coffee\Documents\ad_clicker> python ad_clicker.py -q "wireless keyboard" -t 5 --auth -pf proxies2.txt -e "amazon"

please advise

[Question] Premium version still undetected?

Sorry for posting this here as it's a question rather than a bug, but I couldn't find anywhere else to ask it.

Is the premium version of the tool currently fully working and undetected? I notice there was an issue before with the chromedriver causing the clicks to be detected as invalid, but has this been resolved now?

Thanks

Proxy not being activated in the first run

I am using a proxy and having a breakpoint as soon as the page is loaded. When the page is loaded, it is showing the language of my PC IP, you can check that also from the Swedish Language. The same ip is also after a reload. But if you visit the Extentions, and get back to a new tab, it is showing the proxy, in this case, Italian IP.

ConnectionRefusedError: [Errno 111] Connection refused

hi,
I just met github and i m interesting your this project. I have this errors, what can i do it?

14-05-2021 02:08:58 [ INFO] 21: Changing ip address...
Traceback (most recent call last):
File "/usr/bin/env/lib/python3.9/site-packages/stem/socket.py", line 535, in _make_socket
control_socket.connect((self.address, self.port))
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/bin/ad_clicker.py", line 75, in
main()
File "/usr/bin/ad_clicker.py", line 57, in main
change_ip_address(password)
File "/usr/bin/ad_clicker.py", line 22, in change_ip_address
with Controller.from_port(port=9051) as controller:
File "/usr/bin/env/lib/python3.9/site-packages/stem/control.py", line 1033, in from_port
control_port = stem.socket.ControlPort(address, port)
File "/usr/bin/env/lib/python3.9/site-packages/stem/socket.py", line 503, in init
self.connect()
File "/usr/bin/env/lib/python3.9/site-packages/stem/socket.py", line 172, in connect
self._socket = self._make_socket()
File "/usr/bin/env/lib/python3.9/site-packages/stem/socket.py", line 538, in _make_socket
raise stem.SocketError(exc)
stem.SocketError: [Errno 111] Connection refused

thank you

Issue when running with proxy

image
I'm having this problem every time I try to run with a proxy, I've tried to solve it for 30 mins to no avail, can you help?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.