Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3643365

Browse filesBrowse files
committed
添加firefox 浏览器渲染说明
1 parent 0fcf91d commit 3643365
Copy full SHA for 3643365

3 files changed

+9-3Lines changed: 9 additions & 3 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎docs/source_code/浏览器渲染.md‎

Copy file name to clipboardExpand all lines: docs/source_code/浏览器渲染.md
+7-1Lines changed: 7 additions & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
框架内置一个浏览器渲染池,默认的池子大小为1,请求时重复利用浏览器实例,只有当代理失效请求异常时,才会销毁、创建一个新的浏览器实例
66

7+
内置浏览器渲染支持 **CHROME****PHANTOMJS****FIREFOX**
8+
79
## 使用方式:
810

911
```python
@@ -22,7 +24,7 @@ WEBDRIVER = dict(
2224
user_agent=None, # 字符串 或 无参函数,返回值为user_agent
2325
proxy=None, # xxx.xxx.xxx.xxx:xxxx 或 无参函数,返回值为代理地址
2426
headless=False, # 是否为无头浏览器
25-
driver_type="CHROME", # CHROME PHANTOMJS,
27+
driver_type="CHROME", # CHROME PHANTOMJS、FIREFOX
2628
timeout=30, # 请求超时时间
2729
window_size=(1024, 800), # 窗口大小
2830
executable_path=None, # 浏览器路径,默认为默认路径
@@ -128,6 +130,10 @@ class TestRender(feapder.AirSpider):
128130
browser.find_element_by_id("su").click()
129131
time.sleep(5)
130132
print(browser.page_source)
133+
134+
# response也是可以正常使用的
135+
# response.xpath("//title")
136+
# response.text
131137

132138

133139
if __name__ == "__main__":
Collapse file

‎feapder/setting.py‎

Copy file name to clipboardExpand all lines: feapder/setting.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
user_agent=None, # 字符串 或 无参函数,返回值为user_agent
6464
proxy=None, # xxx.xxx.xxx.xxx:xxxx 或 无参函数,返回值为代理地址
6565
headless=False, # 是否为无头浏览器
66-
driver_type="CHROME", # CHROMEPHANTOMJS,
66+
driver_type="CHROME", # CHROMEPHANTOMJS、FIREFOX
6767
timeout=30, # 请求超时时间
6868
window_size=(1024, 800), # 窗口大小
6969
executable_path=None, # 浏览器路径,默认为默认路径
Collapse file

‎feapder/templates/project_template/setting.py‎

Copy file name to clipboardExpand all lines: feapder/templates/project_template/setting.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
# user_agent=None, # 字符串 或 无参函数,返回值为user_agent
5151
# proxy=None, # xxx.xxx.xxx.xxx:xxxx 或 无参函数,返回值为代理地址
5252
# headless=False, # 是否为无头浏览器
53-
# driver_type="CHROME", # CHROMEPHANTOMJS,
53+
# driver_type="CHROME", # CHROMEPHANTOMJS、FIREFOX
5454
# timeout=30, # 请求超时时间
5555
# window_size=(1024, 800), # 窗口大小
5656
# executable_path=None, # 浏览器路径,默认为默认路径

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.