Skip to content

Commit a697afb

Browse files
sazimaClément Denoix
authored andcommitted
SeleniumRequest use keyword parameters (#49)
1 parent 509ee53 commit a697afb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Use the `scrapy_selenium.SeleniumRequest` instead of the scrapy built-in `Reques
3636
```python
3737
from scrapy_selenium import SeleniumRequest
3838

39-
yield SeleniumRequest(url, self.parse_result)
39+
yield SeleniumRequest(url=url, callback=self.parse_result)
4040
```
4141
The request will be handled by selenium, and the request will have an additional `meta` key, named `driver` containing the selenium driver with the request processed.
4242
```python
@@ -62,8 +62,8 @@ from selenium.webdriver.common.by import By
6262
from selenium.webdriver.support import expected_conditions as EC
6363

6464
yield SeleniumRequest(
65-
url,
66-
self.parse_result,
65+
url=url,
66+
callback=self.parse_result,
6767
wait_time=10,
6868
wait_until=EC.element_to_be_clickable((By.ID, 'someid'))
6969
)
@@ -73,8 +73,8 @@ yield SeleniumRequest(
7373
When used, selenium will take a screenshot of the page and the binary data of the .png captured will be added to the response `meta`:
7474
```python
7575
yield SeleniumRequest(
76-
url,
77-
self.parse_result,
76+
url=url,
77+
callback=self.parse_result,
7878
screenshot=True
7979
)
8080

@@ -87,8 +87,8 @@ def parse_result(self, response):
8787
When used, selenium will execute custom JavaScript code.
8888
```python
8989
yield SeleniumRequest(
90-
url,
91-
self.parse_result,
90+
url=url,
91+
callback=self.parse_result,
9292
script='window.scrollTo(0, document.body.scrollHeight);',
9393
)
9494
```

0 commit comments

Comments
 (0)