Using AutoIT with Selenium

前端 未结 1 1073
不知归路
不知归路 2021-01-29 16:30

Thank you for answering my previous question but as one is solved another is found apparently.

Interacting with the flash game itself is now the problem. I have tried re

1条回答
  •  囚心锁ツ
    2021-01-29 16:59

    Yes, you can use any number of scraping libraries (scrapy and beautiful soup are both easy to use and very powerful). Personally though, I like Selenium and its python bindings because they're the most flexible. Your final script would look something like this:

    from selenium import webdriver
    from selenium.webdriver.common.keys import Keys
    
    driver = webdriver.Firefox()
    driver.get("http://xx.yy.zz")
    
    # Click the "New comer, click here to play!" button
    elem = driver. find_element_by_partial_link_text("Click here to play")
    elem.send_keys(Keys.RETURN)
    

    Can you post what the source of the page looks like (maybe using a Pastebin)?

    Edit: updated to show you how to click the "Click here to play" button.

    0 讨论(0)
提交回复
热议问题