OxbridgeEconomics
commited on
Update ndrc.py
Browse files
ndrc.py
CHANGED
@@ -52,6 +52,7 @@ while i > -1:
|
|
52 |
article['publishDate'] = datemodifier(page.xpath("//meta[@name = 'firstpublishedtime']/@content")[0], "%Y-%m-%d-%H:%M:%S")
|
53 |
elif "/zcfb/tz/" in url:
|
54 |
url = url.replace("../../zcfb/tz/", "https://www.ndrc.gov.cn/xxgk/zcfb/tz/")
|
|
|
55 |
req = urllib.request.urlopen(url)
|
56 |
text = req.read()
|
57 |
html_text = text.decode("utf-8")
|
@@ -73,6 +74,7 @@ while i > -1:
|
|
73 |
else:
|
74 |
url = url.replace("../../", "https://www.ndrc.gov.cn/xxgk/jd/jd/")
|
75 |
url = url.replace("./", "https://www.ndrc.gov.cn/xxgk/jd/jd/")
|
|
|
76 |
req = urllib.request.urlopen(url)
|
77 |
text = req.read()
|
78 |
html_text = text.decode("utf-8")
|
|
|
52 |
article['publishDate'] = datemodifier(page.xpath("//meta[@name = 'firstpublishedtime']/@content")[0], "%Y-%m-%d-%H:%M:%S")
|
53 |
elif "/zcfb/tz/" in url:
|
54 |
url = url.replace("../../zcfb/tz/", "https://www.ndrc.gov.cn/xxgk/zcfb/tz/")
|
55 |
+
print(url)
|
56 |
req = urllib.request.urlopen(url)
|
57 |
text = req.read()
|
58 |
html_text = text.decode("utf-8")
|
|
|
74 |
else:
|
75 |
url = url.replace("../../", "https://www.ndrc.gov.cn/xxgk/jd/jd/")
|
76 |
url = url.replace("./", "https://www.ndrc.gov.cn/xxgk/jd/jd/")
|
77 |
+
print(url)
|
78 |
req = urllib.request.urlopen(url)
|
79 |
text = req.read()
|
80 |
html_text = text.decode("utf-8")
|