This work now lives at community-supported https://github.com/pharo-contributions/Soup.
A port of from Python of Beautiful Soup. Initial versions by Zulq Alam.
Copied from http://smalltalkhub.com/#!/~PharoExtras/Soup on 7/28/2016
License: MIT License
This work now lives at community-supported https://github.com/pharo-contributions/Soup.
A port of from Python of Beautiful Soup. Initial versions by Zulq Alam.
Copied from http://smalltalkhub.com/#!/~PharoExtras/Soup on 7/28/2016
Asked on Pharo Discord:
What is the replacement for String>>#convertForWithConverter:
, which has been removed in P10? Soup was using it and I'm not sure how to translate to the new Zn-based encoders. Naively, I tried just restoring the method in P10, but:
aByteString convertFromWithConverter: aZnSimplifiedEncoder "latin1 strict"
cc/ @svenvc
We used to add it as an extension method, which now makes Zinc dirty.
Peter's tool
Method SoupParser>>parseStartTag converts the tag that it read to lowercase. Method SoupParser>>handleEndTag does not do this, which causes SoupParser>>numPops to not find the opening tag in the tagStack.
If you need an example, the following snippet does not parse the HTML page correctly:
page := ZnClient new get: 'http://elib.zib.de/pub/mp-testdata/tsp/tsplib/tsp/index.html'.
"uncomment the following line to correctly parse the page"
"page := page asLowercase."
soup := Soup fromString: page.
Usually I would make a pull request for this, but (1) I am relatively new to Smalltalk and (2) I have never worked with the Pharo GitHub integration.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.