Selenium SQLite 没有这样的列public_routeable 错误?
Posted
技术标签:
【中文标题】Selenium SQLite 没有这样的列public_routeable 错误?【英文标题】:Selenium SQLite no such column publicly_routable Error? 【发布时间】:2022-01-19 22:00:21 【问题描述】:直到最近我的程序一直运行良好,并且我没有更改代码中的任何内容。上次我遇到这样的 selenium 问题是因为我的 chrome 更新了它的版本,但这次我的 chrome 版本没有改变。
我的代码也不使用 SQLite 之类的东西。
Chrome 版本: 版本 94.0.4606.54(正式版)(64 位)
我用来启动 selenium 的代码:
def launch_web_driver(self,single_website = False):
if self.web_driver is None or not self.check_if_browser_alive():
user_directory = "C:\\Users\\bestg\\AppData\\Local\\Google\\Chrome\\" + self.data_dir
config_options = Options()
config_options.add_argument(f'user-data-dir=user_directory')
try:
self.launch_message()
self.web_driver = webdriver.Chrome(options = config_options)
self.visit_website(self.initial_url)
except Exception as e:
print(f"Selenium error: \nstr(e)")
if 'user data directory is already in use' in str(e):
url = self.web_driver.command_executor._url #"http://127.0.0.1:60622/hub"
session_id = self.web_driver.session_id #'4e167f26-dc1d-4f51-a207-f761eaf73c31
self.web_driver = webdriver.Remote(command_executor=url,desired_capabilities=)
self.web_driver.session_id = session_id
elif single_website and self.web_driver.current_url != self.initial_url:
self.visit_website(self.initial_url)
错误消息:
December 16 2021 03:30:03 PM | Launching web driver
DevTools listening on ws://127.0.0.1:1600/devtools/browser/af61a701-c7dc-408c-b875-367663e26405
[7024:7764:1216/153004.922:ERROR:database.cc(1761)] History SQLite error: code 1 errno 0: no such column: publicly_routable sql: SELECT id,url,visit_time,from_visit,transition,segment_id,visit_duration,incremented_omnibox_typed_score,publicly_routable FROM visits WHERE id=?
[7024:7764:1216/153004.922:ERROR:database.cc(1761)] History SQLite error: code 1 errno 0: no such column: publicly_routable sql: SELECT id,url,visit_time,from_visit,transition,segment_id,visit_duration,incremented_omnibox_typed_score,publicly_routable FROM visits WHERE url=? ORDER BY visit_time DESC, id DESC LIMIT ?
[7024:7764:1216/153004.926:ERROR:database.cc(1761)] History SQLite error: code 1 errno 0: no such column: publicly_routable sql: SELECT id,url,visit_time,from_visit,transition,segment_id,visit_duration,incremented_omnibox_typed_score,publicly_routable FROM visits WHERE url=? ORDER BY visit_time DESC, id DESC LIMIT ?
[7024:7764:1216/153004.938:ERROR:database.cc(1761)] History SQLite error: code 1 errno 0: no such column: publicly_routable sql: SELECT id,url,visit_time,from_visit,transition,segment_id,visit_duration,incremented_omnibox_typed_score,publicly_routable FROM visits WHERE url=? ORDER BY visit_time DESC, id DESC LIMIT ?
[7024:7764:1216/153005.337:ERROR:database.cc(1761)] History SQLite error: code 1 errno 0: no such column: publicly_routable sql: SELECT id,url,visit_time,from_visit,transition,segment_id,visit_duration,incremented_omnibox_typed_score,publicly_routable FROM visits WHERE url=? ORDER BY visit_time DESC, id DESC LIMIT ?
[7024:7764:1216/153006.406:ERROR:database.cc(1761)] History SQLite error: code 1 errno 0: no such column: publicly_routable sql: SELECT id,url,visit_time,from_visit,transition,segment_id,visit_duration,incremented_omnibox_typed_score,publicly_routable FROM visits WHERE url=? ORDER BY visit_time DESC, id DESC LIMIT ?
[7024:18884:1216/153007.485:ERROR:chrome_browser_main_extra_parts_metrics.cc(228)] crbug.com/1216328: Checking Bluetooth availability started. Please report if there is no report that this ends.
[7024:18884:1216/153007.485:ERROR:chrome_browser_main_extra_parts_metrics.cc(231)] crbug.com/1216328: Checking Bluetooth availability ended.
[7024:18884:1216/153007.486:ERROR:chrome_browser_main_extra_parts_metrics.cc(234)] crbug.com/1216328: Checking default browser status started. Please report if there is no report that this ends.
[7024:10988:1216/153007.488:ERROR:device_event_log_impl.cc(214)] [15:30:07.488] USB: usb_device_handle_win.cc:1048 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
[7024:10988:1216/153007.490:ERROR:device_event_log_impl.cc(214)] [15:30:07.490] USB: usb_device_handle_win.cc:1048 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
[7024:18884:1216/153007.494:ERROR:chrome_browser_main_extra_parts_metrics.cc(238)] crbug.com/1216328: Checking default browser status ended.
[7024:7764:1216/153007.504:ERROR:database.cc(1761)] History SQLite error: code 1 errno 0: no such column: publicly_routable sql: SELECT id,url,visit_time,from_visit,transition,segment_id,visit_duration,incremented_omnibox_typed_score,publicly_routable FROM visits WHERE url=? ORDER BY visit_time DESC, id DESC LIMIT ?
【问题讨论】:
【参考方案1】:此错误消息...
[7024:7764:1216/153004.922:ERROR:database.cc(1761)] History SQLite error: code 1 errno 0: no such column: publicly_routable sql: SELECT id,url,visit_time,from_visit,transition,segment_id,visit_duration,incremented_omnibox_typed_score,publicly_routable FROM visits WHERE id=?
[7024:7764:1216/153004.922:ERROR:database.cc(1761)] History SQLite error: code 1 errno 0: no such column: publicly_routable sql: SELECT id,url,visit_time,from_visit,transition,segment_id,visit_duration,incremented_omnibox_typed_score,publicly_routable FROM visits WHERE url=? ORDER BY visit_time DESC, id DESC LIMIT ?
...暗示ChromeDriver 与 [tag"google-chrome] 版本不兼容。
解决方案
可能您的 Google Chrome 浏览器已更新,您使用的是最新的 Google Chrome 版本 96.0.4664.110,因此您必须下载并安装匹配的 ChromeDriver 96.0.4664.45
【讨论】:
谢谢!我不知道它会如何更新我以为我禁用了更新。我会尽快尝试一下,看看它是否能解决它以上是关于Selenium SQLite 没有这样的列public_routeable 错误?的主要内容,如果未能解决你的问题,请参考以下文章
android.database.sqlite.SQLiteException:没有这样的列:标题:,编译时: