All Projects → sachaarbonel → beautifulsoup.dart

sachaarbonel / beautifulsoup.dart

Licence: MIT license
A dart port of the famous python library beautifulsoup

Programming Languages

dart
5743 projects

Projects that are alternatives of or similar to beautifulsoup.dart

Djangohunter
Tool designed to help identify incorrectly configured Django applications that are exposing sensitive information.
Stars: ✭ 212 (+1015.79%)
Mutual labels:  beautifulsoup
SD-streams
Anime streaming without ads using Beautifulsoup and requests Python
Stars: ✭ 18 (-5.26%)
Mutual labels:  beautifulsoup
linkedinBot
Automate the process of sending referral request and cold mailing on LinkedIn
Stars: ✭ 25 (+31.58%)
Mutual labels:  beautifulsoup
Euro2016 TerminalApp
⚽ Instantly find 🏆EURO 2016 live-streams & highlights, now a Web App!
Stars: ✭ 54 (+184.21%)
Mutual labels:  beautifulsoup
wechat articles spider
A Spider About Wechat Articles 、Official Accounts
Stars: ✭ 25 (+31.58%)
Mutual labels:  beautifulsoup
web-scraping-with-python
In this repository i will expalin how to scrap websites using python programming language with BeautifulSoup and requestsmodulues
Stars: ✭ 44 (+131.58%)
Mutual labels:  beautifulsoup
Jssoup
JavaScript + BeautifulSoup = JSSoup
Stars: ✭ 203 (+968.42%)
Mutual labels:  beautifulsoup
grailer
web scraping tool for grailed.com
Stars: ✭ 30 (+57.89%)
Mutual labels:  beautifulsoup
BookingScraper
🌎 🏨 Scrape Booking.com 🏨 🌎
Stars: ✭ 68 (+257.89%)
Mutual labels:  beautifulsoup
Tieba-Birthday-Spider
百度贴吧生日爬虫,可抓取贴吧内吧友生日,并且在对应日期自动发送祝福
Stars: ✭ 28 (+47.37%)
Mutual labels:  beautifulsoup
wikipedia-reference-scraper
Wikipedia API wrapper for references
Stars: ✭ 34 (+78.95%)
Mutual labels:  beautifulsoup
linkedin-scraper
Tool to scrape linkedin
Stars: ✭ 74 (+289.47%)
Mutual labels:  beautifulsoup
PTT Beauty Spider
PTT 表特版爬蟲圖片下載器
Stars: ✭ 47 (+147.37%)
Mutual labels:  beautifulsoup
GoodReadsScraper
📚 A GoodReads.com Scraper script to get books reviews including text and rating.
Stars: ✭ 36 (+89.47%)
Mutual labels:  beautifulsoup
html-table-extractor
extract data from html table
Stars: ✭ 74 (+289.47%)
Mutual labels:  beautifulsoup
Csdnbot
CSDN 资源下载器
Stars: ✭ 209 (+1000%)
Mutual labels:  beautifulsoup
WhatSoup
A web scraper that exports your entire WhatsApp chat history.
Stars: ✭ 86 (+352.63%)
Mutual labels:  beautifulsoup
PacPaw
Pawn package manager for SA-MP
Stars: ✭ 14 (-26.32%)
Mutual labels:  beautifulsoup
Data-Wrangling-with-Python
Simplify your ETL processes with these hands-on data sanitation tips, tricks, and best practices
Stars: ✭ 90 (+373.68%)
Mutual labels:  beautifulsoup
non-api-fb-scraper
Scrape public FaceBook posts from any group or user into a .csv file without needing to register for any API access
Stars: ✭ 40 (+110.53%)
Mutual labels:  beautifulsoup

"Provide idiomatic ways of navigating, searching, and modifying the parse tree. It commonly saves programmers hours or days of work"

Usage

A simple usage example:

import 'package:beautifulsoup/beautifulsoup.dart';

main() {
  String document = """
  <html><head><title>The Dormouse's story</title></head>
  <body>
  <p class="title"><b>The Dormouse's story</b></p>

  <p class="story">Once upon a time there were three little sisters; and their names were
  <a href="http://example.com/elsie" class="sister" id="link1">Elsie</a>,
  <a href="http://example.com/lacie" class="sister" id="link2">Lacie</a> and
  <a href="http://example.com/tillie" class="sister" id="link3">Tillie</a>;
  and they lived at the bottom of a well.</p>

  <p class="story">...</p>
  """;
  
  var soup = Beautifulsoup(document);
  
  print(soup("title").outerHtml); //soup.title
  print(soup("title").localName); //soup.title.name
  print(soup("title").text); //soup.title.string
  print(soup("title").parent.localName); //soup.title.parent.name
  print(soup("p").outerHtml); //soup.title.parent.name
  print(soup("p").attributes["class"]); //soup.p['class']
  print(soup("a").outerHtml); //soup.a
  print(soup.get_text()); //soup.get_text()
  print(soup.find_all("a").map((e)=> (e.outerHtml)).toList());
}

Modifying text via class name

  String document = """
   <p id="RipVanWinkle">
    RipVanWinkle paragraph.
  </p>
    """;
    
  var soup = Beautifulsoup(document);
  soup.find(id:"#RipVanWinkle").text = "Wake up, sleepy head!";
  print(soup.print());

Modify text by tag

  String document = """
  <a href="http://example.com/">I linked to <i>example.com</i></a>
  """;
    
  var soup = Beautifulsoup(document);
  soup("a").text ="New link text";
  print(soup.print());

Find all links in a html document

String document = """
    <html>
    <head>
      <title>
      The Dormouse's story
      </title>
    </head>
    <body>
      <p class="title">
      <b>
        The Dormouse's story
      </b>
      </p>
      <p class="story">
      Once upon a time there were three little sisters; and their names were
      <a class="sister" href="http://example.com/elsie" id="link1">
        Elsie
      </a>
      ,
      <a class="sister" href="http://example.com/lacie" id="link2">
        Lacie
      </a>
      and
      <a class="sister" href="http://example.com/tillie" id="link2">
        Tillie
      </a>
      ; and they lived at the bottom of a well.
      </p>
      <p class="story">
      ...
      </p>
    </body>
    </html>
    """;
    
    var soup = Beautifulsoup(document);
    var hyperlinks = soup.find_all("a").map((e)=> print(soup.attr(e,"href"))).toList();
    

Features and bugs

Please file feature requests and bugs at the issue tracker.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].