def get_url():
url = "https://github.com/search?q=pingan&type=repositories&p=2"
res = requests.get(url)
name = re.findall('"hl_name":"(.*?)"',res.text)
value = re.findall('"hl_trunc_description":"(.*?)"',res.text)
return name,value
如图所示,我在爬取github上面的一些标题和内容,github会返回给我一个json字符串,我用正则表达式去匹配我需要的字段,但hl_trunc_description字段如下图会存在null值,re.findall函数并不会统计这些null值,我应该怎么解决这个问题?使得标题和内容能够匹配