Kod:
from selenium import webdriver
import random
import time
browser= webdriver.Firefox()
url="https://eksisozluk.com/mustafa-kemal-ataturk--34712?p="
pagecount=1
entries=[]
entrycount=1
while pagecount<=10:
ramdonpage=random.randint(1,1290)
newurl=url+str(ramdonpage)
browser.get(newurl)
elements=browser.Find_Elements_By_Css_Selector(".content")
for element in elements: # hata burada
entries.append(element.text)
time.sleep(3)
pagecount+=1
for entry in entries:
print("*************************************")
print(entry)
Hata:
Traceback (most recent call last):
File "***", line 16, in
for element in elements:
TypeError: 'NoneType' object is not iterable
Process finished with exit code 1