-
Notifications
You must be signed in to change notification settings - Fork 0
/
fibo.py
33 lines (24 loc) · 748 Bytes
/
fibo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from ghost import Ghost
def test():
g = Ghost(wait_timeout=10)
g = Ghost(display=True)
g.open("http://www.google.com")
def test1():
url = "http://www.ebay.com/"
gh = Ghost()
# We create a new page
page, page_name = gh.create_page()
# We load the main page of ebay
page_resource = page.open(url, wait_onload_event=True)
# Full the main bar and click on the search button
page.set_field_value("#gh-ac", "plane")
page.click("#gh-btn")
# Wait for the next page
page.wait_for_selector("#e1-15")
# Save the image of the screen
page.capture_to("plane.png")
def test2():
ghost = Ghost()
page, resources = ghost.open('http://www.baidu.com')
if __name__=='__main__':
test()