如何在使用Ghost.py提交表单后获得下一页

How can i get next page after submit form using Ghost.py

本文关键字:表单 一页 提交 py Ghost      更新时间:2023-09-26

我使用Ghost.py来填写表格。提交表格后,我得到了相同的页面。代码:

url_local = 'url'
gh = Ghost()
page, name = gh.create_page()
page.open(url_local, wait_onload_event=True)
page.wait_for_selector('#id_username')
page.set_field_value('#id_username', '1')
page.set_field_value('#id_password', '1')
page.capture_to("1.png")
page.fire_on('form', 'submit')
page.capture_to("2.png")

我怎样才能得到下一页?

提交后,尝试使用等待

page, resources = ghost.wait_for_page_loaded()

然后捕获