nhtp/examples/find.nim

9 lines
245 B
Nim
Raw Normal View History

2020-11-02 19:59:15 +01:00
import engine, httpclient, strtabs
2021-10-18 19:15:13 +02:00
var html = Engine()
html.run(newHttpClient().getContent("http://example.com"))
2020-11-02 19:59:15 +01:00
2020-11-02 20:00:29 +01:00
echo html.find("title").getAllText()
2020-11-02 19:59:15 +01:00
echo html.find("meta", args={"http-equiv": "Content-type"}.newStringTable).args["content"]