-1

I can't interfere with any element on this site. Could you help ? Thank you very much for your answers in advance.

https://pttws.ptt.gov.tr/info_web/info_kayit.jsp

driver = webdriver.Chrome()
  
driver.get("https://pttws.ptt.gov.tr/info_web/info_kayit.jsp")
inputs = driver.find_element(By.TAG_NAME, "input")

for input_element in inputs:
    print(input_element.get_attribute("id"))

++

devTools listening on ws://127.0.0.1:52080/devtools/browser/196a44c6-8117-4520-bce9-a02c51c2a35f Traceback (most recent call last): File "C:\Users\r00t\Downloads\test_ptt.py", line 16, in inputs = driver.find_elements(By.TAG_NAME, "input") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 861, in find_elements return self.execute(Command.FIND_ELEMENTS, {"using": by, "value": value})["value"] or [] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1 Answers1

0

I tried the code that you've provided, but the webpage is taking too long to load, it is timing out, causing the error.

from bs4 import BeautifulSoup as bs
import requests

inputs = bs(requests.get("https://pttws.ptt.gov.tr/info_web/info_kayit.jsp").text, 'html.parser').find_all('input')

for input_element in inputs:
    print(input_element.get("id"))

I got the following output with the code.

None
None
None
None
tc_kn
yu_kn
v_kn
kurumsalUnvan
ad_soyad
gsmAlan
gsmNo
evTelAlan
evTel
e_posta
kepAdresi
barkodNo
hesapNo
konu
image1
image2
image3
dosya3
dosya1
dosya2
guvenlik

Similarly, if you want to submit the form, you can do it through requests as well.

Zero
  • 1,807
  • 1
  • 6
  • 17
  • I can't interact with selenium any element on the site I share – Yunus Emre Kula Jun 23 '23 at 15:15
  • I agree, I tried the same as well, that's because it takes too long to load the page that it times out before you can interact. That's why I used `requests` – Zero Jun 23 '23 at 15:26