update regex to match `'` and `"` in <option> tag

the new versions of MediaWiki use `'`, older use `"`.
pull/448/head
yzqzss 1 year ago committed by GitHub
parent 9d614cf8ad
commit 331f8e122b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -170,7 +170,7 @@ def getNamespacesScraper(config={}, session=None):
# [^>]*? to include selected="selected"
m = re.compile(
r'<option [^>]*?value="(?P<namespaceid>\d+)"[^>]*?>(?P<namespacename>[^<]+)</option>').finditer(raw)
r'<option [^>]*?value=[\'"](?P<namespaceid>\d+)[\'"][^>]*?>(?P<namespacename>[^<]+)</option>').finditer(raw)
if 'all' in namespaces:
namespaces = []
for i in m:

Loading…
Cancel
Save