我知道如何在attrs参数的帮助下根据准确的id进行过滤.
tables = pd.read_html(url, attrs={"id": "box-CHI-game-basic"})
我事先不知道确切的ID,我知道它的 struct .我可以用正则表达式捕获id:
re.search(".+-game-basic", "box-CHI-game-basic")
如果只将正则表达式添加为attr的值,则不起作用.
Read_html的Match参数可以使用regex,但它遍历整个文本,我想将其范围缩小到id.