Skip to main content

Beryllium Package

This is beryllium package. You can use beryllium to write your lean.

Installation

pip install beryllium

Beryllium Demo

# -*- coding: utf-8 -*-

from beryllium import Beryllium
import time
from beryllium import FieldList, Field, FieldName, Page, ListCssSelector, Mongodb, NextPageCssSelectorSetup, PageFunc
bery = Beryllium()
bery.driver = bery.get_driver()
bery.fast_get_page("https://www.baidu.com")
time.sleep(1)
bery.until_send_text_by_css_selector(css_selector="#kw", text="杭州")
bery.until_send_enter_by_css_selector(css_selector="#kw")
time.sleep(2)

fieldlist_shop = FieldList(
    Field(field_name=FieldName.SHOP_NAME, css_selector="h3"),
)
page_shop = Page(name="shop_page",
                 field_list=fieldlist_shop,
                 list_css_selector=ListCssSelector(list_css_selector="#content_left > div.result.c-container"))

bery.until_click_no_next_page_by_css_selector(
    next_page_setup=NextPageCssSelectorSetup(
        page=page_shop,
        css_selector="#page > a.n",
        main_page_func=PageFunc(func=bery.from_page_get_data_list, page=page_shop)
    )
)

Demonstration

Outlook

Committed to creating an interactive crawler library. I hope programmers with the same desire to join my development. You can contact me by email: wujunleiwang@gmail.com

Download files

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

Source Distribution

beryllium-1.0.4.tar.gz (23.9 kB view details)

Uploaded Source

File details

Details for the file beryllium-1.0.4.tar.gz.

File metadata

  • Download URL: beryllium-1.0.4.tar.gz
  • Upload date:
  • Size: 23.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for beryllium-1.0.4.tar.gz
Algorithm Hash digest
SHA256 d8560a46048167d7f7ef3d49d7b0edcd3c2e961aa7fcfa57dedb86b2b18af649
MD5 b3a1eba737b0f5e2de8ef1b0953932c4
BLAKE2b-256 a2dfb96cba8247f9dce9c763d622a15b8bfcb2bce40726f878ae84963b26cc63

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.4 This release

1 file

1.0.3

1 file

1.0.2

1 file

1.0.1

1 file

1.0.0

1 file

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page