当前位置:网站首页>Crawling data encounters single point login problem
Crawling data encounters single point login problem
2022-07-06 18:38:00 【Big folk song】
Crawling website data is , Find the same token At the same time, it is kept in domainA.cn and domainB.com Next , adopt selenium To achieve login free access to data , Summary of knowledge points to solve cross domain problem finding .
Browser cross domain problem understanding ?
The same-origin policy :
Three is the same : agreement , port , domain name
The purpose of formulating homology strategy :
Prevent request forgery : Front end interaction , Get the server token stored in token Next , If there is no homology strategy ,token It can be easily obtained by other molecules .
Three limitations of non homology :
Can't get the cookie、localstorage and indexedDB
Can't access non homologous pages DOM (iframe)
Can't send... To a non homologous address AJAX request or fetch request ( Can send , But the browser refused to accept the response )
How to solve cross domain problems :
- Server implementation CORS Interface understanding
The server interacts with the client ,http Add... To the request header ACCESS Start parameter to interact
A simple request : The actual request contains ACCESS parameter information
Pre inspection request : Before sending the actual request , Send a OPTION request , After passing the inspection , Send the actual request
The preview request with the certificate needs to be in the request header withCredentials Set to true
For details, please refer to the link : Cross source resource sharing (CORS) - HTTP | MDN
- Use JavaScript Of src Properties are implemented without cross domain restrictions
Request header X-Requested-With What is the function of parameters ?
Can be judged ajax Request or other request . Server interpretation allows browsers to cross source servers , issue XMLHttpRequest request
Documents referenced in the article :
Cross source resource sharing (CORS) - HTTP | MDN
Thoroughly understand the cross domain of browser - Nuggets
Cross domain single sign on solution implementation - Nuggets
Different domain names pass JSONP Cross domain sharing cookie- Huang Yunxin's blog
边栏推荐
- Grafana 9.0 is officially released! It's the strongest!
- Stm32+hc05 serial port Bluetooth design simple Bluetooth speaker
- Penetration test information collection - site architecture and construction
- STM32+MFRC522完成IC卡号读取、密码修改、数据读写
- There is a sound prompt when inserting a USB flash disk under win10 system, but the drive letter is not displayed
- 2022-2024年CIFAR Azrieli全球学者名单公布,18位青年学者加入6个研究项目
- Stm32+mfrc522 completes IC card number reading, password modification, data reading and writing
- Distill knowledge from the interaction model! China University of science and Technology & meituan proposed virt, which combines the efficiency of the two tower model and the performance of the intera
- 测试123
- STM32+HC05串口蓝牙设计简易的蓝牙音箱
猜你喜欢

使用cpolar建立一个商业网站(1)

None of the strongest kings in the monitoring industry!

小程序在产业互联网中的作用

徐翔妻子应莹回应“股评”:自己写的!

MS-TCT:Inria&SBU提出用于动作检测的多尺度时间Transformer,效果SOTA!已开源!(CVPR2022)...

Maixll dock camera usage

线代笔记....
![[.Net core] solution to error reporting due to too long request length](/img/62/6bdc43885f9be3fa4538276c0dc122.png)
[.Net core] solution to error reporting due to too long request length

Breadth first traversal of graph

10、 Process management
随机推荐
ORACLE进阶(四)表连接讲解
视频化全链路智能上云?一文详解什么是阿里云视频云「智能媒体生产」
C#/VB.NET 给PDF文档添加文本/图像水印
MS-TCT:Inria&SBU提出用于动作检测的多尺度时间Transformer,效果SOTA!已开源!(CVPR2022)...
线代笔记....
node の SQLite
287. 寻找重复数
Medical image segmentation
CSRF vulnerability analysis
UFIDA OA vulnerability learning - ncfindweb directory traversal vulnerability
测试1234
图之广度优先遍历
Brief description of SQL optimization problems
Epoll () whether it involves wait queue analysis
Introduction to the use of SAP Fiori application index tool and SAP Fiori tools
A method of sequentially loading Unity Resources
How does crmeb mall system help marketing?
Shangsilicon Valley JUC high concurrency programming learning notes (3) multi thread lock
巨杉数据库首批入选金融信创解决方案!
Reproduce ThinkPHP 2 X Arbitrary Code Execution Vulnerability