Skip to main content

A sao shen library

Project description

dumb_menu

Downloads

The brother version of the Drissionpage library, SaossionPage, is referred to as Sao Shen for short

Installation


pip install SaossionPage

Usage

example 1: Print the tree structure of the element tag

from SaossionPage import Browser





if __name__ == '__main__':

    browser = Browser(config=" ")



    browser.open('https://www.doc88.com/')



    t=browser.page.latest_tab

    y=t.ele('t:body')

    t.wait(2)     

    # 打印元素标签的树结构

    browser.get_tree(y)  



    input(' press any key to exit')

example 2: Convert native HTML tag syntax to DP library element syntax

#将原生html标签语法转换成DP库元素语法

from SaossionPage import Browser,Use





if __name__ == '__main__':

    #连接浏览器

    b=Browser()

    t=b.page.new_tab('https://www.baidu.com/')

    #获取元素



    search_botton=t.ele(Use.raw('<input type="submit" id="su" value="百度一下" class="bg s_btn">'))

    

    print(search_botton)



    input(' press any key to exit')

example 3: Foolish browser startup configuration

# 傻瓜式浏览器启动配置

from SaossionPage import Browser





if __name__ == '__main__':



    #  连接浏览器  傻瓜式自动识别配置

    browser = Browser(  r"C:\Users\Application\chrome.exe",config=' 静音  无图 代理http://127.0.0.1:1080 ')



    # 打开网站 

    browser.open('https://www.bing.com/')    



    input(' press any key to exit')

example 4: High-definition element screenshots

# 高清元素截图

from SaossionPage import Browser



if __name__ == '__main__':

    browser = Browser(config=" ")



    browser.open('https://www.python.org/')

    t=browser.page.latest_tab

    y=t.ele('t:body')

    t.wait(2)

     

    # 打印树结构

    browser.get_shot_by_canvas(tab=t,ele=y,name='shot.png')     







    input(' press any key to exit')

Update log

  • 1.0.2 update README.md

  • 1.0.1 fix bug

  • 1.0.0 first release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

SaossionPage-1.0.2.tar.gz (94.9 kB view details)

Uploaded Source

File details

Details for the file SaossionPage-1.0.2.tar.gz.

File metadata

  • Download URL: SaossionPage-1.0.2.tar.gz
  • Upload date:
  • Size: 94.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.3

File hashes

Hashes for SaossionPage-1.0.2.tar.gz
Algorithm Hash digest
SHA256 f9cb2f88e379149fb20d2256ec16a6d58c9ec9981308e97c9ae4143c59e348d9
MD5 227ce3aa0ab4a2ed4b372fd56bedbea6
BLAKE2b-256 d18676c47a414159ae23f42d9b08409b1c7512f8e3fb501e11ac2a6e44d9610f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page