File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11"""
22This 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
44go to special pages -> Bot passwords ; follow the instructions)
55"""
6+
67from osw .express import OswExpress
78from osw .params import GetPageParam
89
1213# Demo Article
1314fullpagetitle_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+ )
1922print (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
2225page_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+ )
2628print (page_html )
You can’t perform that action at this time.
0 commit comments