使用 Selenium 和 Python 设置了与 http://yahoo.com/ 上的 cross-site 资源关联的 cookie,但没有使用 `SameSite` 属性
A cookie associated with a cross-site resource at http://yahoo.com/ was set without the `SameSite` attribute using Selenium and Python
我正在通过 selenium
抓取一个站点,在应用建议的 headers 和 chrome 选项后,它在所需输出 [=16= 之间的输出中向我展示了这一点]...
我的代码:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) ' \
'Chrome/80.0.3987.132 Safari/537.36'
driver_exe = 'chromedriver'
options = Options()
options.add_argument("--headless")
options.add_argument(f'user-agent={user_agent}')
options.add_argument("--disable-web-security")
options.add_argument("--allow-running-insecure-content")
options.add_argument("--allow-cross-origin-auth-prompt")
options.add_argument("--disable-cookie-encryption")
driver = webdriver.Chrome(executable_path=r"C:\Users\intel\Downloads\Setups\chromedriver.exe", options=options)
driver.get("https://www.amazon.com/s?k=asus&rh=n%3A300189&nav_sdd=aps&pd_rd_r=58b28d7d-1955-433b-b33b-b1b5dcf1f522&pd_rd_w=MJzan&pd_rd_wg=QG3cj&pf_rd_p=6d81377b-6d6c-4363-ae02-8fa202ed7b50&pf_rd_r=X0BDDAPN7TTW0ZT1REX6&qid=1583290662&ref=sxwds-sbc_c2")
class_Name = "a-size-medium a-color-base a-text-normal"
x = driver.find_elements_by_class_name(class_Name.replace(' ','.'))
for i in list(x):
print(i.text,"\n")
中间有 CORS 策略的输出:
Asus AC1900 Dual Band Gigabit WiFi Router with MU-Mimo, Aimesh for Mesh WIFI System, Aiprotection Network Security Powered by Trend Micro, Adaptive Qos and Parental Control (RT-AC68U)
ASUS AC2900 WiFi Dual-band Gigabit Wireless Router with 1.8GHz Dual-core Processor and AiProtection Network Security Powered by
Trend Micro, AiMesh Whole Home WiFi System Compatible (RT-AC86U)
ASUS AC3200 Tri-Band Gigabit WiFi Router, AiProtection Lifetime Security by Trend Micro, Adaptive QoS, Parental Control (RT-AC3200)
ASUS RT-AX3000 Dual Band WiFi Router, WiFi 6, 802.11ax, Lifetime Internet Security, Support AiMesh Whole-Home WiFi, 4 x 1Gb LAN
Ports, USB 3.0, MU-MIMO, OFDMA, VPN
ASUS Dual-Band Gigabit WiFi Gaming Router (AC3100) with MU-MIMO, supporting AiProtection network security by Trend Micro, AiMesh for Mesh WiFi system, and WTFast game Accelerator (RT-AC88U)
ASUS RT-AC66U B1 AC1750 Dual-Band WiFi Router, AiProtection Lifetime Security by Trend Micro, AiMesh Compatible for Mesh WiFi System
Asus Blue Cave AC2600 Dual-Band Wireless Router for Smart Homes, Featuring Intel Wifi Technology and Aiprotection Network Security Powered by Trend Micro,White
ASUS Rapture GT-AX11000 Tri-Band 10 Gigabit WiFi Router (RENEWED)
Asus Wireless AC3100 Gigabit Router (RT-AC3100)
ASUS RT-AC68U AiMesh (2 pack) AC1900 Whole Home Dual-band AiMesh Mesh Wifi System, AiProtection Lifetime Security by Trend Micro, Adaptive QoS, Parental Control
ASUS Dual-Band 2x2 AC1300 Super-Fast WiFi 4-Port Gigabit Router with MU-MIMO and USB 3.0 (RT-ACRH13)
ASUS RT-AC1200 V2 AC1200 Dual Band WiFi Router, Easy 3-Step Setup, 4 LAN Ports, VPN, Gaming & Streaming
CYD 65W Powerfast Replacement for Laptop-Charger Asus Zenbook Vivobook Eee Book a53s a53u a450 a52f a53e a54c f551 f554 k401 k501 k55 x401 x450 x501 x502 x550 x551 x552 x554 x555 Power-ac-Adapter
ASUS RT-AC88U Dual-band (2.4 GHz / 5 GHz) Gigabit Ethernet Black,Red 3G 4G
ASUS SRT-AC1900 AC1900 Onhub Google WiFi Router
Asus Wireless AC1200 Dual-Band Router - (RT-AC1200)
ASUS RT-N66R Dual-Band Wireless-N900 Gigabit Router IEEE 802.11a/b/g/n, IEEE 802.3/3u/3ab
ASUS (RT-N16) Wireless-N 300 Maximum Performance single band Gaming Router: Fast Gigabit Ethernet, support USB-Hard Drive and Printer and Open source DDWRT
ASUS RT-N66U Dual-Band Wireless-N900 Gigabit Router
[0306/125211.693:INFO:CONSOLE(0)] "A cookie associated with a cross-site resource at http://yahoo.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.", source: https://www.amazon.com/s?k=asus&rh=n%3A300189&nav_sdd=aps&pd_rd_r=58b28d7d-1955-433b-b33b-b1b5dcf1f522&pd_rd_w=MJzan&pd_rd_wg=QG3cj&pf_rd_p=6d81377b-6d6c-4363-ae02-8fa202ed7b50&pf_rd_r=X0BDDAPN7TTW0ZT1REX6&qid=1583290662&ref=sxwds-sbc_c2 (0)
[0306/125211.696:INFO:CONSOLE(0)] "A cookie associated with a cross-site resource at https://yahoo.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.", source: https://www.amazon.com/s?k=asus&rh=n%3A300189&nav_sdd=aps&pd_rd_r=58b28d7d-1955-433b-b33b-b1b5dcf1f522&pd_rd_w=MJzan&pd_rd_wg=QG3cj&pf_rd_p=6d81377b-6d6c-4363-ae02-8fa202ed7b50&pf_rd_r=X0BDDAPN7TTW0ZT1REX6&qid=1583290662&ref=sxwds-sbc_c2 (0)
ASUS GT-AC5300 ROG Rapture TriBand 4x4 AC5300 Gaming WiFi Router
ASUS RT-AC87R Wireless-AC2400 Dual Band Gigabit Router
ASUS RT-AC66R 802.11ac Dual-Band Wireless-AC1750 Gigabit Router
ASUS Dual-Band AC750 wireless router 733 Mbps with USB port (RT-AC51U)
NETGEAR Nighthawk X4S Smart WiFi Router (R7800) - AC2600 Wireless Speed (up to 2600 Mbps) | Up to 2500 sq ft Coverage & 45 Devices | 4 x 1G Ethernet, 2 x 3.0 USB, and 1 x eSATA ports
ASUS RT-AC1900 Dual Band WiFi Router
如何从我的输出中删除 CORS 行??如有任何帮助,我们将不胜感激!
这个错误信息...
[0306/125211.693:INFO:CONSOLE(0)] "A cookie associated with a cross-site resource at http://yahoo.com/ was set without the `SameSite` attribute.
...是一个 INFO 来宣传这个新标准以提高开发人员的采用率。
A future release of Chrome will only deliver cookies with cross-site
requests if they are set with SameSite=None and Secure. You can review
cookies in developer tools under Application>Storage>Cookies and see
more details at https://www.chromestatus.com/feature/5088147346030592
and https://www.chromestatus.com/feature/5633521622188032.
我正在通过 selenium
抓取一个站点,在应用建议的 headers 和 chrome 选项后,它在所需输出 [=16= 之间的输出中向我展示了这一点]...
我的代码:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) ' \
'Chrome/80.0.3987.132 Safari/537.36'
driver_exe = 'chromedriver'
options = Options()
options.add_argument("--headless")
options.add_argument(f'user-agent={user_agent}')
options.add_argument("--disable-web-security")
options.add_argument("--allow-running-insecure-content")
options.add_argument("--allow-cross-origin-auth-prompt")
options.add_argument("--disable-cookie-encryption")
driver = webdriver.Chrome(executable_path=r"C:\Users\intel\Downloads\Setups\chromedriver.exe", options=options)
driver.get("https://www.amazon.com/s?k=asus&rh=n%3A300189&nav_sdd=aps&pd_rd_r=58b28d7d-1955-433b-b33b-b1b5dcf1f522&pd_rd_w=MJzan&pd_rd_wg=QG3cj&pf_rd_p=6d81377b-6d6c-4363-ae02-8fa202ed7b50&pf_rd_r=X0BDDAPN7TTW0ZT1REX6&qid=1583290662&ref=sxwds-sbc_c2")
class_Name = "a-size-medium a-color-base a-text-normal"
x = driver.find_elements_by_class_name(class_Name.replace(' ','.'))
for i in list(x):
print(i.text,"\n")
中间有 CORS 策略的输出:
Asus AC1900 Dual Band Gigabit WiFi Router with MU-Mimo, Aimesh for Mesh WIFI System, Aiprotection Network Security Powered by Trend Micro, Adaptive Qos and Parental Control (RT-AC68U)
ASUS AC2900 WiFi Dual-band Gigabit Wireless Router with 1.8GHz Dual-core Processor and AiProtection Network Security Powered by
Trend Micro, AiMesh Whole Home WiFi System Compatible (RT-AC86U)
ASUS AC3200 Tri-Band Gigabit WiFi Router, AiProtection Lifetime Security by Trend Micro, Adaptive QoS, Parental Control (RT-AC3200)
ASUS RT-AX3000 Dual Band WiFi Router, WiFi 6, 802.11ax, Lifetime Internet Security, Support AiMesh Whole-Home WiFi, 4 x 1Gb LAN
Ports, USB 3.0, MU-MIMO, OFDMA, VPN
ASUS Dual-Band Gigabit WiFi Gaming Router (AC3100) with MU-MIMO, supporting AiProtection network security by Trend Micro, AiMesh for Mesh WiFi system, and WTFast game Accelerator (RT-AC88U)
ASUS RT-AC66U B1 AC1750 Dual-Band WiFi Router, AiProtection Lifetime Security by Trend Micro, AiMesh Compatible for Mesh WiFi System
Asus Blue Cave AC2600 Dual-Band Wireless Router for Smart Homes, Featuring Intel Wifi Technology and Aiprotection Network Security Powered by Trend Micro,White
ASUS Rapture GT-AX11000 Tri-Band 10 Gigabit WiFi Router (RENEWED)
Asus Wireless AC3100 Gigabit Router (RT-AC3100)
ASUS RT-AC68U AiMesh (2 pack) AC1900 Whole Home Dual-band AiMesh Mesh Wifi System, AiProtection Lifetime Security by Trend Micro, Adaptive QoS, Parental Control
ASUS Dual-Band 2x2 AC1300 Super-Fast WiFi 4-Port Gigabit Router with MU-MIMO and USB 3.0 (RT-ACRH13)
ASUS RT-AC1200 V2 AC1200 Dual Band WiFi Router, Easy 3-Step Setup, 4 LAN Ports, VPN, Gaming & Streaming
CYD 65W Powerfast Replacement for Laptop-Charger Asus Zenbook Vivobook Eee Book a53s a53u a450 a52f a53e a54c f551 f554 k401 k501 k55 x401 x450 x501 x502 x550 x551 x552 x554 x555 Power-ac-Adapter
ASUS RT-AC88U Dual-band (2.4 GHz / 5 GHz) Gigabit Ethernet Black,Red 3G 4G
ASUS SRT-AC1900 AC1900 Onhub Google WiFi Router
Asus Wireless AC1200 Dual-Band Router - (RT-AC1200)
ASUS RT-N66R Dual-Band Wireless-N900 Gigabit Router IEEE 802.11a/b/g/n, IEEE 802.3/3u/3ab
ASUS (RT-N16) Wireless-N 300 Maximum Performance single band Gaming Router: Fast Gigabit Ethernet, support USB-Hard Drive and Printer and Open source DDWRT
ASUS RT-N66U Dual-Band Wireless-N900 Gigabit Router
[0306/125211.693:INFO:CONSOLE(0)] "A cookie associated with a cross-site resource at http://yahoo.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.", source: https://www.amazon.com/s?k=asus&rh=n%3A300189&nav_sdd=aps&pd_rd_r=58b28d7d-1955-433b-b33b-b1b5dcf1f522&pd_rd_w=MJzan&pd_rd_wg=QG3cj&pf_rd_p=6d81377b-6d6c-4363-ae02-8fa202ed7b50&pf_rd_r=X0BDDAPN7TTW0ZT1REX6&qid=1583290662&ref=sxwds-sbc_c2 (0)
[0306/125211.696:INFO:CONSOLE(0)] "A cookie associated with a cross-site resource at https://yahoo.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.", source: https://www.amazon.com/s?k=asus&rh=n%3A300189&nav_sdd=aps&pd_rd_r=58b28d7d-1955-433b-b33b-b1b5dcf1f522&pd_rd_w=MJzan&pd_rd_wg=QG3cj&pf_rd_p=6d81377b-6d6c-4363-ae02-8fa202ed7b50&pf_rd_r=X0BDDAPN7TTW0ZT1REX6&qid=1583290662&ref=sxwds-sbc_c2 (0)
ASUS GT-AC5300 ROG Rapture TriBand 4x4 AC5300 Gaming WiFi Router
ASUS RT-AC87R Wireless-AC2400 Dual Band Gigabit Router
ASUS RT-AC66R 802.11ac Dual-Band Wireless-AC1750 Gigabit Router
ASUS Dual-Band AC750 wireless router 733 Mbps with USB port (RT-AC51U)
NETGEAR Nighthawk X4S Smart WiFi Router (R7800) - AC2600 Wireless Speed (up to 2600 Mbps) | Up to 2500 sq ft Coverage & 45 Devices | 4 x 1G Ethernet, 2 x 3.0 USB, and 1 x eSATA ports
ASUS RT-AC1900 Dual Band WiFi Router
如何从我的输出中删除 CORS 行??如有任何帮助,我们将不胜感激!
这个错误信息...
[0306/125211.693:INFO:CONSOLE(0)] "A cookie associated with a cross-site resource at http://yahoo.com/ was set without the `SameSite` attribute.
...是一个 INFO 来宣传这个新标准以提高开发人员的采用率。
A future release of Chrome will only deliver cookies with cross-site requests if they are set with SameSite=None and Secure. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.