safari

Safari console.log show all entries

谁说我不能喝 提交于 2021-01-27 06:53:16
问题 I have a javascript array with about 300 entries and whenever I want to print it with console.log in the Safari console I can see the index 0 to 99 and thats it. How can I show the other entries? In Chrome everything works fine, it shows a block with index 0 to 99, then a block from 100 - 199 and so on... But on safari there is only one block from 0 to 99. Is it possible that Safari only shows the first 100 entries? 来源: https://stackoverflow.com/questions/42413642/safari-console-log-show-all

爱看小说的有福了......

落爺英雄遲暮 提交于 2021-01-27 06:40:50
利用Python3 编写爬虫,从笔趣阁爬小说,可以下载到手机看。 运行截图: 程序实现如下: ---有点小bug,不过无所谓了。。。 import re import urllib.request import time import easygui as g # 输入地址 g.msgbox( " " ) msg = "输入小说地址,例如http://www.biquge.com.tw/0_213/" title = '爬虫' root = g.enterbox(msg , title) # 伪造浏览器 headers = { 'User-Agent' : 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) ' \ 'AppleWebKit/537.36 (KHTML, like Gecko)' \ ' Chrome/62.0.3202.62 Safari/537.36' } req = urllib.request.Request( url =root , headers =headers) with urllib.request.urlopen(req , timeout = 1 ) as response: # 大部分的涉及小说的网页都有charset='gbk',所以使用gbk编码 htmls = response.read().decode

How to force Instagram to open a link in Safari rather than the in app browser

爱⌒轻易说出口 提交于 2021-01-27 05:22:42
问题 Instagram has added an inapp browser that automatically is used when links are opened. My websites need to be opened in a normal browser such as Safari (for iPhone). I am trying to figure out how to force it to redirect to a proper browser. If this link is opened through Instagram browser, it will request to be opened in safari, And I am trying to do this: http://ogurl.co/BOJ 回答1: To answer your question, the in app browser for Instagram or any app is a design decision made by the producer of

04 Python网络爬虫 <<爬取get/post请求的页面数据>>之requests模块

自古美人都是妖i 提交于 2021-01-25 06:50:25
一. urllib库   urllib是Python自带的一个用于爬虫的库,其主要作用就是可以通过代码模拟浏览器发送请求。其常被用到的子模块在Python3中的为urllib.request和urllib.parse,在Python2中就是urllib和urllib2。 二.requests库   - 安装: pip install requests   - 作用: 就是用来模拟浏览器上网的   - 特点: 简单高效   - 使用流程:      * 指定url      * 发起请求      * 获取响应数据      * 持久化存储 三.爬取简单的网页    普通 get请求 1 # 爬取搜狗首页的页面数据 2 import requests 3 # 第一步指定url 4 url = ' https://www.sogou.com/ ' 5 # 第二步发送请求 6 response = request.get(url= url) 7 # 第三步获取响应数据 8 page_text = response.text # text返回的是字符串类型的数据(由响应体中的content-type,也可以是json) 9 # 第四步持久化存储 10 with open( ' ./souhu.html ' , ' w ' ,encoding= ' utf-8 ' ) as fp: 11

《大秦赋》最近很火!于是我用Python抓取了“相关数据”,发现了这些秘密......

给你一囗甜甜゛ 提交于 2021-01-24 13:05:47
↑ 关注 + 星标 ,每天学Python新技能 后台回复【 大礼包 】送你Python自学大礼包 前言 最近,最火的电视剧莫过于《大秦赋了》,自12月1日开播后,收获了不错的口碑。然而随着电视剧的跟新,该剧在网上引起了 激烈的讨论 ,不仅口碑急剧下滑,颇有 高开低走的趋势 ,同时该剧的评分也由最初的8.9分,下降到了现在的6.5分。 虽然我还没有看过这个新剧,但是对于小伙伴们讨论的内容,却颇有兴趣(主要还是大家老是讨 论这个剧)。因此, 我用Python爬取了《大秦赋》的相关数据 ,进行了一波分析。 数据爬取 巧妇难为无米之炊,做数据分析之前最重要的就是 “数据获取” 。于是,我准备用Python爬取豆瓣上的 短评数据 以及一些 评论时间信息 、 评价星级信息 。 关于数据的爬取主要说以下几个内容: 1) 关于翻页操作 第一页: https://movie.douban.com/subject/ 26413293 /comments?status=P 第二页: https://movie.douban.com/subject/ 26413293 /comments?start= 20 &limit= 20 &status=P&sort=new_score 第三页: https://movie.douban.com/subject/ 26413293 /comments?start=

《Charles从入门到精通》之截取截取Https通讯信息和模拟慢速网络

不羁的心 提交于 2021-01-23 06:50:36
声明:《Charles从入门到精通》系列文章均参考于唐巧大神的博客,您可以点击“阅读原文”来阅读巧叔的博客~ 截取HTTPS通讯信息 安装证书 如果你需要截取分析HTTPS协议相关的内容,那么需要安装Charles的CA证书。具体步骤如下。 首先,我们需要在Mac电脑上安装证书。点击Charles的顶部菜单,选择“Help”->“SSL Proxying”->“Install Charles Root Certificate”。如下图: 这样在Keychain中就可以看到下图所示的内容: 需要注意的是,这个证书是不被信任的,因为系统默认是不信任Charles的证书的。此时需要对证书右键->"显示简介",然后将“使用此证书时”选项改为始终信任,如下图所示: 这是需要输入登录密码来授权的,在我们输入完密码之后,在Keychain中显示的证书就是这样的了: 这样,证书就安装完成了。但是需要注意的是, 即使是安装完证书以后,Charles默认也是不截取HTTPS网络通讯的信息的,如果你想截取某个网站上的所有HTTPS网络请求,那么你可以在该请求上进行右击,然后选择“Enable SSL Proxying” ,如下图所示: 这样当SSL Proxying 的状态是Enable的时候,就配置完成了~然后该Host的所有HTTPS的请求就可以被请求到了。 截取移动设备上的https通讯信息

python 嵌套爬取网页信息

半城伤御伤魂 提交于 2021-01-23 06:34:27
当需要的信息要经过两个链接才能打开的时候,就需要用到嵌套爬取。 比如要爬取起点中文网排行榜的小说简介,找到榜单网址: https://www.qidian.com/all?orderId=&style=1&pageSize=20&siteid=1&pubflag=0&hiddenField=0&page=1 将榜单上的小说链接爬出来,在从小说链接里面爬小说简介 import pymysql import requests from hashlib import md5 import re import os #获取网页源代码 def get_one_page(url): # 设置请求头,防止被网站屏蔽 headers = { ' User-Agent ' : ' Mozilla/5.0 (Windows NT 6.1; Win64; x64)\ AppleWebKit/ 537.36 (KHTML, like Gecko) Chrome/ 58.0 . 3029.110 Safari/ 537.36 ' , } try : r = requests. get (url, headers= headers) r.raise_for_status() r.encoding = r.apparent_encoding return r.text except requests

touch bar的4个使用小技巧

余生颓废 提交于 2021-01-21 21:03:18
大家都知道MacBook Pro的实体功能键改成了Touchbar,目前全系的MacBook Pro都带了Touchbar。在刚推出的时候,一些人吐槽Touchbar,但是如果用了,习惯了之后,就真的回不去了。 想要玩转touch bar其实并不难,下面给大家介绍几个Touchbar使用的小技巧。 1、截图 Touchbar也是可以截图的,保存为图片的快捷键是command+shift+6,如果放到剪贴板里,快捷键是command+shift+control+6。更多的截图快捷键我们可以在系统偏好设置-->键盘-->屏幕快照里进行查看和设置。 2、自定义快捷键 就比如刚才说的截图,其实我们可以自定义一个在Touchbar上,如果需要截图的时候,直接按一下就可以呼出截图对话框,当然还可以定义其他的,比如锁屏、休眠等等。 进入系统偏好设置-->键盘-->自定义触控栏,把需要的按钮拖下来即可。 3、显示F1-F12快捷键 在默认情况下,Touchbar会根据不同的APP显示不同的快捷键,我们可以长按Fn显示F1到F12。 如果想把Touchbar默认显示为F1-F12,可以在系统偏好设置-->键盘-->触控栏显示里定义。 如果想根据不同的APP显示不同的Touchbar,我们可以在系统偏好设置-->键盘-->快捷键-->Fn功能键中设置,添加应用到列表,这些应用默认就显示F1-F12键。

Safari 13+ iframe blocks CORS cookies

那年仲夏 提交于 2021-01-21 12:20:23
问题 Safari flat out doesn't let you set cookies in iframes of domains different than the parent domain, server-side CORS headers be damned. To clarify: user is on domainA.com. An iframe for domainB.com is open, and attempts to authenticate the user on domainB.com inside the iframe. Set-Cookie header is returned from the server inside the domainB.com iframe, with all the required headers, but Safari isn't sending it back in subsequent calls. An old workaround was doing a form submit from the

Safari 13+ iframe blocks CORS cookies

爱⌒轻易说出口 提交于 2021-01-21 12:19:07
问题 Safari flat out doesn't let you set cookies in iframes of domains different than the parent domain, server-side CORS headers be damned. To clarify: user is on domainA.com. An iframe for domainB.com is open, and attempts to authenticate the user on domainB.com inside the iframe. Set-Cookie header is returned from the server inside the domainB.com iframe, with all the required headers, but Safari isn't sending it back in subsequent calls. An old workaround was doing a form submit from the