Created
April 15, 2015 21:48
-
-
Save StrykerKKD/44c897dbe1877b767cbf to your computer and use it in GitHub Desktop.
Web scraping with Dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:http/http.dart' as http; | |
import 'package:html/parser.dart' as parser; | |
import 'package:html/dom.dart'; | |
main() async { | |
http.Response response = await http.get('https://news.ycombinator.com/'); | |
Document document = parser.parse(response.body); | |
document.getElementsByTagName('a').forEach((Element element){ | |
print(element.text); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment