python-3.x - 几个月来一直没有错误地运行它 - 现在得到)]“未捕获(承诺)TypeError:无法获取”
问题描述
我已经运行这部分代码几个月没有错误,现在得到:“Uncaught (in promise) TypeError: Failed to fetch” 即使我以前的版本现在也失败了。
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as ec
from selenium.common.exceptions import *
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
vars = {}
from tkinter import *
import datetime
import winsound
import re
def makeOneReservation():
global driver
driver=webdriver.Edge(executable_path='C:\Python27amd64\msedgedriver')
driver.get("https://www.canyonoakscc.com/")
makeOneReservation()
错误:
DevTools listening on ws://127.0.0.1:53979/devtools/browser/dcd9054e-10ae-4df0-87f5-2ab9b0fb892f
Press any key to continue . . . [19532:25280:1017/110133.543:ERROR:CONSOLE(0)] "Access to fetch at
'https://www.bing.com/rp/rms_pr.png' from origin 'https://ntp.msn.com' has been blocked by CORS
policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque
response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS
disabled.", source: https://ntp.msn.com/edge/ntp?locale=en-US&fre=1&dsp=1&sp=Bing&prerender=1 (0)
[19532:25280:1017/110133.549:ERROR:CONSOLE(1)] "UnhandledError:Error: TypeError: Failed to fetch
Stack:Error: TypeError: Failed to fetch
at https://assets.msn.com/bundles/v1/edgeChromium/latest/vendors.32298e43877474399a50.js:1:206118
[object Object] Sat Oct 17 2020 11:01:33 GMT-0700 (Pacific Daylight Time)", source:
https://assets.msn.com/bundles/v1/edgeChromium/latest/vendors.32298e43877474399a50.js (1)
[19532:25280:1017/110133.549:ERROR:CONSOLE(0)] "Uncaught (in promise) TypeError: Failed to fetch",
source: https://ntp.msn.com/edge/ntp?locale=en-US&fre=1&dsp=1&sp=Bing&prerender=1 (0)
该程序确实继续并成功完成,但为什么现在出现此错误?我能做些什么来消除这个错误?尝试了两个推荐的插件,但都没有。
解决方案
推荐阅读
- c - 使用此语法在 flex/bison 中出现语法错误
- ring - ring monoid,任何人都可以举一个不是另一个的例子吗
- python - 为什么这段代码无法将复数转换为浮点数?或者我得到无效的语法
- java - 删除时违反数据模型的参照完整性约束
- javascript - CSS动画功能在IE浏览器中不起作用
- excel - 限制用户表单中的文本框接受 mm/dd/yy 格式的日期
- c# - 如何根据我们在文本框中输入的单词过滤下拉列表?
- java - 小助手类的OOP设计
- google-bigquery - Cloud Storage 中的 BigQuery DTS 失败
- php - 我的网址中的“/index.php?admin/admin_dashboard”是什么意思