Skip to content

Commit 990197b

Browse files
committed
fix: code style
1 parent 86f50b2 commit 990197b

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

‎examples/get_page_content.py‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
"""
22
This example shows how to get the main slot or html content of a OSW page
3-
prerequisite: valid bot password in the used OSW instance (Log in, then
3+
prerequisite: valid bot password in the used OSW instance (Log in, then
44
go to special pages -> Bot passwords ; follow the instructions)
55
"""
6+
67
from osw.express import OswExpress
78
from osw.params import GetPageParam
89

@@ -12,15 +13,16 @@
1213
# Demo Article
1314
fullpagetitle_to_download = "Item:OSWac34aa10f897463f966724d86eece3da"
1415

15-
## getting the page content from the main slot (without info box...)
16-
page_content = osw.site.get_page(GetPageParam(
17-
titles = [fullpagetitle_to_download]
18-
)).pages[0].get_slot_content("main")
16+
# getting the page content from the main slot (without info box...)
17+
page_content = (
18+
osw.site.get_page(GetPageParam(titles=[fullpagetitle_to_download]))
19+
.pages[0]
20+
.get_slot_content("main")
21+
)
1922
print(page_content)
2023

21-
## getting the html of the actually visible page including info-box and further elements
24+
# getting the html of the actually visible page including info-box and further elements
2225
page_html = osw.site._site.raw_api(
23-
action="parse",
24-
page = fullpagetitle_to_download,
25-
format="json")
26+
action="parse", page=fullpagetitle_to_download, format="json"
27+
)
2628
print(page_html)

0 commit comments

Comments
 (0)