某有名グルメサイトのスクレイピングをpythonで試みていますが上手くいきません。
TAB LOG

URL毎に
・店名
・電話番号
・住所
・営業時間
を取得する予定です。

当初場所をCSSセレクターで指定していたものの、ページによって位置が若干変わってしまうようです。
おそらく文字列(”営業時間”)を含むタグを探して、その中身を出力?のようなことでできる気がするのですが、いくら調べてもやり方がわかりません。

以下は参考までに、現時点での営業時間を取得する部分のコードですが、気にしないで貰ってかまわないです。

平日と休日を分けて出力するのを意図しています。
tablinkにURLを入れます

ご教授宜しくお願いします

import csv
import re
import requests
import pandas as pd
from bs4 import BeautifulSoup
def left(text, n):
return text[:n]
def right(text, n):
return text[n:]
def get_dotwlefts(tablink):
response = requests.get(tablink)
html = response.content
soup = BeautifulSoup(html,"html.parser")
dotwfound = soup.select_one("#contents-rstdata > div.rstinfo-table > table:nth-child(2) > tbody > tr:nth-child(7) > td > p")
if dotwfound is not None:
dotw = dotwfound.text
if dotwfound is None:
dotw = ""
m = re.search(r"[土|【土|[土・日【日|土・日|日祝|土日祝|日・祝|[日・祝|土・日・祝|土日|土、日|[金|【金|[日|金/土", dotw, flags=re.DOTALL)
y = m.start() if m else None
dotwlefts = left(dotw,y)
dotwrights = right(dotw,y)
if dotwlefts==dotwrights:
dotwrights = ""
return dotwlefts
def get_dotwrights(tablink):
response = requests.get(tablink)
html = response.content
soup = BeautifulSoup(html,"html.parser")
dotwfound = soup.select_one("#contents-rstdata > div.rstinfo-table > table:nth-child(2) > tbody > tr:nth-child(7) > td > p")
if dotwfound is not None:
dotw = dotwfound.text
if dotwfound is None:
dotw = ""
m = re.search(r"[土|【土|[土・日【日|土・日|日祝|土日祝|日・祝|[日・祝|土・日・祝|土日|土、日|[金|【金|[日|金/土", dotw, flags=re.DOTALL)
y = m.start() if m else None
dotwlefts = left(dotw,y)
dotwrights = right(dotw,y)
if dotwlefts==dotwrights:
dotwrights = ""
return dotwrights