Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improved algorithm #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 13 additions & 16 deletions scrapers/eksi_scraper/eksi_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,20 @@
def eksisozluk_scrape():
def initialize():
def preference(scrape_input, question):
while (scrape_input.lower() != "y") or (scrape_input.lower() != "n"):
if scrape_input.lower() == "y":
output = True
break

elif scrape_input.lower() == "n":
output = False
break

else:
print("Geçersiz yanıt.")
scrape_input = input(question)
scrape_input = scrape_input.lower()

while scrape_input not in ("y", "n"):
print("Geçersiz yanıt.")
scrape_input = input(question).lower()

else:
if scrape_input == "y":
return True
return False

return output

def delay_check(delay):
while type(delay) != int:
while not isinstance(delay, int):
try:
delay = int(delay)
except ValueError:
Expand All @@ -44,7 +41,7 @@ def delay_check(delay):

title = input("Entrylerin çekileceği başlık: ")
file = input("Oluşturulacak Excel dosyasının adı: ")
file = file + ".xlsx"
file += ".xlsx"
delay = delay_check(input("Bekleme süresi(sn): "))

entry_texts = []
Expand Down Expand Up @@ -181,4 +178,4 @@ def scrape():
scrape()

if __name__ == "__main__":
eksisozluk_scrape()
eksisozluk_scrape()