Skip to main content

A enhanced parser which can extract title, content, images and form from html pages, inspired by jparser

Project description

from __future__ import print_function
import requests
from jableparser import PageModel
html = requests.get("https://hollywoodmask.com/entertainment/jason-carroll-cnn-age-gay.html", verify=False).text
pm = PageModel(html)
result = pm.extract()

print("==title==")
print(result['title')
print("==content==")
for x in result['content']:
    if x['type'] == 'text':
        print(x['data'])
    if x['type'] == 'image':
        print("[IMAGE]", x['data']['src'])
    if x['type'] == 'html':
        print("Raw table string: )
        print(x['data'])
        print("Processed table data if two columns: )
        print(pm.processtable(x['data']))

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

jableparser-0.0.1.tar.gz (5.5 kB view hashes)

Uploaded Source

Built Distribution

jableparser-0.0.1-py3-none-any.whl (7.6 kB view hashes)

Uploaded Python 3

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