Created
September 27, 2023 16:38
-
-
Save tcope25/28ebdbc1c9df9da2dfa9cd04b52944a1 to your computer and use it in GitHub Desktop.
python script to get mediavine travel bloggers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib.request, json, csv | |
sellers = urllib.request.urlopen("https://www.mediavine.com/sellers.json") | |
data = json.load(sellers) | |
csv_file = "domains.csv" | |
sites = [] | |
for item in data["sellers"]: | |
site = item.get("domain") | |
if 'travel' in site: | |
sites.append(site) | |
with open(csv_file, "w", newline="") as csvfile: | |
csv_writer = csv.writer(csvfile) | |
for site in sites: | |
csv_writer.writerow([site]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment