You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
crytobooks/isbn-scraper/tools/get-z3950-sources.py

8 lines
299 B
Python

import requests, re
source = "http://www.loc.gov/z3950/gateway.html"
for match in re.findall('"http:\/\/www\.loc\.gov\/cgi-bin\/zgstart\?ACTION=INIT&FORM_HOST_PORT=\/prod\/www\/data\/z3950\/.+\.html,([^,]+),([0-9]+)"', requests.get(source).text):
host, port = match
print "%s:%s" % (host, port)