Skip to content

Instantly share code, notes, and snippets.

@mightywombat
Last active September 13, 2020 16:10
Show Gist options
  • Save mightywombat/bcada37696a2f4d60e188cae5fdc5794 to your computer and use it in GitHub Desktop.
Save mightywombat/bcada37696a2f4d60e188cae5fdc5794 to your computer and use it in GitHub Desktop.
#!python3
import requests as req
import re
first_names_m = []
first_names_f = []
last_names = []
# Get the raw page data into usable text format #
js = req.get('https://www.fantasynamegenerators.com/scripts/russianNames.js')
for match in re.findall("var nm1=(.+?);", js.text):
first_names_m = eval(match)
with open("russian_1st_m.txt", "a+") as f:
f.write(match)
for match in re.findall("var nm2=(.+?);", js.text):
first_names_f = eval(match)
with open("russian_1st_f.txt", "a+") as f:
f.write(match)
for match in re.findall("var nm3=(.+?);", js.text):
last_names = eval(match)
with open("russian_last.txt", "a+") as f:
f.write(match)
print("Male First Names:")
for f_name_m in first_names_m:
print(f_name_m)
print("\n\n")
print("Female First Names:")
for f_name_f in first_names_f:
print(f_name_f)
print("\n\n")
print("Last Names:")
for l_name in last_names:
print(l_name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment