Discuss / 意见、建议和反馈 / 到底怎么发代码呀,然后也不能删除评论。。。

到底怎么发代码呀,然后也不能删除评论。。。

from urllib import request
import re
Name = r'<a href=".*">(.*)</a><br/>'Location = r'<a href=".*" title=".*">(.*)</a></span>'Time = r'<time datetime="(.*)T.*">.*</time>'def main():
    URL = 'https://www.python.org/jobs/'    data = delInf(URL)
def delInf(URL):
    # datalist = []    strInf = request.urlopen(URL).read().decode('utf-8')
    name = re.findall(Name, strInf)
    location = re.findall(Location, strInf)
    time = re.findall(Time, strInf)
    for index in range(0, len(name)):
        print('会议名称:'+ name[index])
        print('会议地点:'+ location[index])
        print('会议时间:'+ time[index] + '\n')
if __name__ == '__main__':
    main()
from urllib import request
import re
Name = r'<a href=".*">(.*)</a><br/>'
Location = r'<a href=".*" title=".*">(.*)</a></span>'
Time = r'<time datetime="(.*)T.*">.*</time>'
def main():
    URL = 'https://www.python.org/jobs/'    
    data = delInf(URL)
def delInf(URL):
    # datalist = []    
    strInf = request.urlopen(URL).read().decode('utf-8')
    name = re.findall(Name, strInf)
    location = re.findall(Location, strInf)
    time = re.findall(Time, strInf)
    for index in range(0, len(name)):
        print('会议名称:'+ name[index])
        print('会议地点:'+ location[index])
        print('会议时间:'+ time[index] + '\n')
if __name__ == '__main__':
    main()

我就自己测试一下


  • 1

Reply