例如这种房间地址:https://www.douyu.com/topic/nzds?rid=5395900 需要增加正则匹配 room_id = re.findall(r'rid=(\d{1,7})', url)[0]