summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/hackernews_login.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/examples/hackernews_login.js b/examples/hackernews_login.js
index 371b8b7..aea9442 100644
--- a/examples/hackernews_login.js
+++ b/examples/hackernews_login.js
@@ -1,16 +1,15 @@
-import { submitForm } from "flyscrape"
+import { parse } from "flyscrape"
+import http from "flyscrape/http"
export const config = {
url: "https://news.ycombinator.com",
}
-export function login() {
- const formData = {
+export function setup() {
+ http.postForm("https://news.ycombinator.com/login", {
"acct": "my-username",
"pw": "my-password",
- }
-
- submitForm("https://news.ycombinator.com/login", formData)
+ })
}
export default function ({ doc }) {