#πŸ”’ Web scarping

24 messages Β· Page 1 of 1 (latest)

tawny flame
#

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
import unittest, time, re
from selenium.webdriver.common.proxy import *
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.common.proxy import Proxy, ProxyType
import threading
import time
import csv
import imaplib
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from threading import Thread,Barrier

#Countryinformation
country = input("Accountcountry:")

def func(threads):

driver = webdriver.Chrome(executable_path=r"C:/Users/Henning/Downloads/chromedriver-win32")
driver.get(url)

try:
    click_button = driver.find_element(By.XPATH,
                                       "/html/body/div[2]/div/div[2]/div/div/div/div/div/section/div[2]/div/button[1]")
    click_button.click()

except:
    print("failed collecting cookies(retrying)")



else:
    print("collected Cookies1")

time.sleep(3)

try:
    driver.execute_script("window.scrollTo(10, document.body.scrollHeight);")
    time.sleep(2)

except:
    print("failed creating Account")
    driver.quit()

else:
    print("scoll down do log in")

time.sleep(1)

try:
    click_button = driver.find_element(By.XPATH,
                                       "/html/body/div[4]/div/footer/div/div[1]/div[1]/div/div[1]/div/ul/li[4]/a")
    click_button.click()

except:
    print("failedcreatingaccount")

else:
    print("reachedpage2")

time.sleep(10)

try:
    click_button = driver.find_element(By.XPATH,
                                       "/html/body/div[6]/div/div/div/div/div/section/div[2]/div/button[1]")
    click_button.click()

except:
    print("failed collecting cookies(retrying)")



else:
    print("collected Cookies2")

time.sleep(1)

try:
    click_button = driver.find_element(By.XPATH,
                                       "/html/body/div[4]/div/div/div[2]/div[4]/div/div/div/div/div[2]/div/div/div/a")
    click_button.click()

except:
    print("failedcreatingaccount")


else:
    print("reachedpage3(register)")

time.sleep(10)

# fillemail

try:
    mail_element = driver.find_element(By.ID, "username")

    print(mail_element)
    time.sleep(1)

    mail_element.send_keys(mail_adresse)

except:
    print("failedtofillmail")

else:
    print("filledmail")

time.sleep(5)

try:
    click_button = driver.find_element(By.XPATH, "/html/body/div[1]/div/div/div/div/form/div/div[4]/button")
    click_button.click()




except:
    print("failedcreatingaccount")

else:
    print("clickedbutton")

threads.wait()

url = ('httpsmeine url' + country + '/launch?s=upcoming')

Threads = 3

barrier = Barrier(Threads)

threads = []

for _ in range(Threads):
i = Thread(target=func, args=(barrier,))
i.start()
threads.append(i)

mortal quartzBOT
#

Hey @tawny flame!

It looks like you're trying to paste code into this channel.

Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes it easier for us to help you.

To do this, use the following method:
```py
print('Hello, world!')
```

This will result in the following:

print('Hello, world!')```
You can **edit your original message** to correct your code block.
mortal quartzBOT
#

@tawny flame

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

tawny flame
#

this is my skript

#

but i get everytime one error

#

Exception in thread Thread-1 (func):
Traceback (most recent call last):
File "C:\Users\Henning\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 1038, in _bootstrap_inner

tawny flame
#

can some explain to me how to fix

fresh pivot
#

Also,

#

!code

mortal quartzBOT
#
Formatting code on Discord

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

For long code samples, you can use our pastebin.

tawny flame
# fresh pivot You cut off the error.

Exception in thread Thread-1 (func):
Traceback (most recent call last):
File "C:\Users\Henning\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 1038, in _bootstrap_inner
Exception in thread Thread-2 (func):
Traceback (most recent call last):
File "C:\Users\Henning\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 1038, in _bootstrap_inner
Exception in thread Thread-3 (func):
Traceback (most recent call last):
File "C:\Users\Henning\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 1038, in _bootstrap_inner
self.run()
File "C:\Users\Henning\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 975, in run
self.run()self._target(*self._args, **self._kwargs)
File "C:\Users\Henning\gigandfinaltoolbox\nikebrowser final.py", line 28, in func

File "C:\Users\Henning\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 975, in run
self.run()
File "C:\Users\Henning\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 975, in run
driver = webdriver.Chrome(executable_path=r"C:\dchrome\chrome\chromedriver.exe")
^^^^ ^self._target(*self._args, **self._kwargs)^
File "C:\Users\Henning\gigandfinaltoolbox\nikebrowser final.py", line 28, in func
^self._target(*self._args, **self._kwargs)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Henning\gigandfinaltoolbox\nikebrowser final.py", line 28, in func
^
driver = webdriver.Chrome(executable_path=r"C:\dchrome\chrome\chromedriver.exe")TypeError
: WebDriver.init() got an unexpected keyword argument 'executable_path'
driver = webdriver.Chrome(executable_path=r"C:\dchrome\chrome\chromedriver.exe")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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

fresh pivot
#

Did you trying Googling that error?

#

That should always be the first thing you do after you determine that you can't solve it yourself.

quartz agate
#

@tawny flame why does this read like an account generator?

tawny flame
#

i treid

fresh pivot
#

Actually, ya, this code looks a bit sketch.

green river
#

!rule

#

!rule 5

mortal quartzBOT
#

5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.

green river
#

he even took out the URL lol

mortal quartzBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.