Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wxnnvs committed Mar 7, 2024
1 parent 7d384bb commit 2a00174
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import requests
from bs4 import BeautifulSoup
from fp.fp import FreeProxy
import os

headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"
Expand All @@ -10,6 +11,9 @@
countries = ["au", "be", "ca", "cl", "cr", "do", "ec", "sv", "fr", "de", "gt", "ie", "jp", "ke", "mx", "nl", "nz", "pa", "pl", "pt", "za", "es", "lk", "se", "ch", "tw", "gb"]

for country in countries:
# Check if the 'countries' folder exists, create it if it doesn't
if not os.path.exists('countries'):
os.makedirs('countries')
with open(f"countries/{country}.txt", "w", encoding="utf-8") as file:
file.write(f"{country.upper()}\n\nCities:\n")

Expand Down

0 comments on commit 2a00174

Please sign in to comment.