I’m trying to run the function but it throws an error. I do not encounter a problem when I run the function without using the streamlit library. Although it gives an error, it opens firefox, enters the user name and password, but does not continue.
FUNCTİON
def login(kullanici,sifresi,rangetime,eklekullaniciadi):
Options = webdriver.FirefoxOptions()
Options.add_argument("--incognito")
driver = webdriver.Firefox(executable_path=GeckoDriverManager().install(), service_log_path='instagram.log',
options=Options)
driver.get("https://www.instagram.com/")
driver.maximize_window()
sleep(1.5)
instausername = driver.find_element(By.XPATH,ix.username)
instausername.send_keys(kullanici)
instapassword = driver.find_element(By.XPATH,ix.password)
instapassword.send_keys(sifresi)
...
STARTING FUNCTION
with tab1:
connect()
table()
c.execute("SELECT * FROM instahesaplar")
hesaplar12 = c.fetchall()
tablo12 = pd.DataFrame(hesaplar12)
tablo12.columns = ["name", "password"]
islemklcad = st.text_input("NAME:")
islemsay = st.number_input("NUMBER:",min_value=1, max_value=200, value=1, step=1)
kachesap = st.number_input("NUMBER2:",min_value=1, max_value=200, value=1, step=1)
zaman2 = 0
if st.button("Start"):
for zaman in range(kachesap):
loginklc = tablo12["name"][zaman2]
loginsif = tablo12["password"][zaman2]
login(loginklc,loginsif,islemsay,islemklcad)
zaman2+=1
st.success("İşlem Tamamlandı")
TRACEBACK
Traceback (most recent call last):
File "C:\Users\Eymen\Desktop\Pycharmprojects\venv\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 556, in _run_script
exec(code, module.__dict__)
File "C:\Users\Eymen\Desktop\Pycharmprojects\instagram.py", line 154, in <module>
login(loginklc,loginsif,islemsay,islemklcad)
File "C:\Users\Eymen\Desktop\Pycharmprojects\instagram.py", line 80, in login
login()
TypeError: login() missing 4 required positional arguments: 'kullanici', 'sifresi', 'rangetime', and 'eklekullaniciadi'