PyQt4 QWebView外部资源内容(PyQt4 QWebView external resource content)
class Browser(QWebView): def __init__(self): QWebView.__init__(self) self.loadFinished.connect(self._result_available) self.loadStarted.connect(self._load_started) self.page().frameCreated.connect(self.onFrame) # ... browser = Browser() browser.setHtml('<html>...</html>', baseUrl=QUrl('http://www.google.com/'))
之后,我需要捕获QWebView加载的所有外部资源的内容 。 我需要获取所有CSS / Javascript文件的内容。 我怎样才能做到这一点 ? 相关问题: 问题1 , 问题2
我知道我需要以某种方式使用QNetworkAccessManager ,但我没有任何使用示例。
class Browser(QWebView): def __init__(self): QWebView.__init__(self) self.loadFinished.connect(self._result_available) self.loadStarted.connect(self._load_started) self.page().frameCreated.connect(self.onFrame) # ... browser = Browser() browser.setHtml('<html>...</html>', baseUrl=QUrl('http://www.google.com/'))
After that, i need to catch content of all external resources loaded by QWebView. I need to get content of all CSS/Javascript files. How can i do that ? Related questions: question 1, question 2
I know i need to use QNetworkAccessManager somehow, but i don't have any example to use.
原文:https://stackoverflow.com/questions/15635972
更新时间:2022-08-13 08:08
最满意答案
不幸的是, 您需要使用额外的代码来处理您的代码,以处理具有访问权限的用户的模拟。
这篇文章解释了如何在页面下方的代码中完成它。
Unfortunately not. You will need to wrap your code using extra code to handle impersonation of a user that does have access.
This article explains how to do it in code further down the page.
相关问答
更多-
不幸的是, 您需要使用额外的代码来处理您的代码,以处理具有访问权限的用户的模拟。 这篇文章解释了如何在页面下方的代码中完成它。 Unfortunately not. You will need to wrap your code using extra code to handle impersonation of a user that does have access. This article explains how to do it in code further down the page.
-
您是否试图将整个回购推送到另一台机器? 最简单的方法是从目标机器到源机器执行“git clone”。 Are you trying to push a whole repo to another machine? The easiest way would be to do a "git clone" from the destination machine to the source machine.
-
经过几次工作,我找到了解决这个问题的方法。 它就像在ASSETSSERVER中创建一个名为“portaluser”的用户(与我的应用程序池标识用户相同)一样简单。 这是违反直觉的:我明确告诉IIS7连接到ASSETSERVER作为assetsuser服务器,但它仍然使用portaluser来检查web.config是否存在(并监视更改)。 看到这一点后,我决定使用相同的帐户来运行应用程序池并连接到远程虚拟目录。 我刚用'assetsuser'而不是'portaluser' 希望这可以帮助 After sev ...
-
另一台机器的时间(Time of another machine)[2022-01-02]
您可以通过编写提供当前时间的服务来实现目标吗? 或连接到远程机器并发送一些wmi查询 类似的问题: http : //social.msdn.microsoft.com/forums/en-US/netfxremoting/thread/f2ff8a33-df5d-4bad-aa89-7b2a2dd73d73/ You can achive by writing a service that gives you the current time? or connecting to remote machin ... -
登录系统设计允许每个用户一次登录一台机器(Login System design to allow each user to be logged in on one machine at a time)[2022-12-01]
一些即时信使(只能用一个登录端点工作)可以很好地整理这些冲突。 他们显示一条消息 您已经从登录 (如果是Web应用程序,那将是 ) 并给你一个选择 或者将该登录保持为活动状态(并且不从您所在的机器登录),或者 结束现有的登录(并在当前机器上登录)。 这在技术上是最具挑战性的,但绝对是最友好的方式 - 它确保用户只有一个会话正在运行,而不是太明显。 而且用户无法登录,因为他们忘记了在工作中注销等情况,因此没有任何不良的情况。 Some Instant Mes ... -
C ++:Cookie不存储在一台机器上,而是存储在另一台机器中(C++ : Cookie not stored in one machine, but stored in another)[2021-12-27]
请参阅在MSDN中管理Cookie 。 它解释了cookie存在于AppData \ Roaming \ Microsoft \ Windows \ Cookies \ Low中 我看不出任何可能的原因导致cookie机制在x64上失败。 我宁愿期望一些本地(IE)配置选项生效,禁止对该站点使用cookie(例如,站点位于不同的区域,或cookie被视为第三方)。 See Managing Cookies in MSDN. It explains that cookies live in AppData\R ... -
看起来你的项目使用了ruby gem sass ,这意味着你需要在每台机器上运行以下命令: [sudo] gem install sass 有关更多信息,SASS最初是一个ruby gem,但libSass允许用户使用其他语言运行SASS。 It looks like your project uses the ruby gem sass, which means you need to run the following on each machine: [sudo] gem install sass F ...
-
也许问题是关于共享会话? 这可以使用序列化J2EE会话或使用共享客户端变量来完成 。 例如,这可以通过以下方式完成。 在其中一台服务器上创建空的数据库(我创建了MySQL数据库)。 在所有CF服务器上创建指向该数据库的数据源。 将此数据源用作服务器设置>客户端变量>名为SharedSessions的客户端会话存储(我们稍后将使用它)。 如果我们在所有服务器的 Application.cfm中使用cflogin,它的代码可以看起来像这样(简化):简短的回答是“这是不可能的”。 问题不仅限于(实际上与目录无关)目录。 它的出现是因为该目录中的文件 确实被删除了 。 (值得注意的是,Git根本不跟踪目录 ,它只是在需要包含文件时创建它们。) 让我们选择一个实际的文件名,以确保完整性。 称之为conf/config.ini 。 你克隆了一些存储库,它有一个名为conf/config.ini的文件,在commit badc0ff ,这是分支master的提示。 你的Git会检查这个提交,所以你的Git会在你的工作树中尽职地创建一个目录conf和一个名为co ...
用户会话和在同一台机器上运行的两个CakePHP应用程序(User sessions and two CakePHP applications running in the same machine)[2022-03-18]
两个应用程序的cookiename和/或缓存前缀应该不同。 您可以在core.php文件中找到这些设置 The cookiename and/or cache prefix should be different for both applications. You can find those settings in the core.php file相关文章
更多- HTTP Content-Type 内容类型详解
- 【第四章】 资源 之 4.2 内置Resource实现 ——跟我学spring3
- 【第四章】 资源 之 4.4 Resource通配符路径 ——跟我学spring3
- 【第四章】 资源 之 4.3 访问Resource ——跟我学spring3
- 移动MM failed to find resource file{mmiap.xml}
- Solr 4.6 | Setting Up an External ZooKeeper Ensemble | upgrade solr to Solr4.6
- The content of element type "package" must match "...
- Python资源索引 【转载】
- 【第四章】 资源 之 4.1 基础知识 ——跟我学spring3
- 【转帖】Python 资源索引
最新问答
更多- 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
- 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
- OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
- 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
- codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
- 在计算机拍照在哪里进入
- 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
- No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
- 单页应用程序:页面重新加载(Single Page Application: page reload)
- 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
- System.StackOverflow错误(System.StackOverflow error)
- KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
- 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
- android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
- TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
- 企业安全培训的各项内容
- 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
- C#类名中允许哪些字符?(What characters are allowed in C# class name?)
- NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
- 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
- 将多个行和可变行移动到列(moving multiple and variable rows to columns)
- 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
- 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
- Angular $资源不会改变方法(Angular $resource doesn't change method)
- 在Angular 5中不是一个函数(is not a function in Angular 5)
- 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
- 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
- 常见的python rpc和cli接口(Common python rpc and cli interface)
- Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
- 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)