Robot

Auction Sniper Challenge

A robot that solves the Auction Sniper challenge.

Playwright

This robot solves the Auction Sniper Challenge.

In this challenge, create a bot that is able to place a bid as close to 0 seconds left in the auction as possible to score the best deal! If your bid is placed with too much time left in the auction, you may find that you get outbid, or end up paying more than a bid that is placed right before the auction ends.

The robot code

Note: There is no one and only "correct" solution. This is just one example of how you might use Robocorp to solve this challenge.

The robot uses the RPA.Browser.Playwright library for browser automation. And that's all we need in this challenge!

Open the auction website and accept cookies

The robot opens a new headless browser and accepts the cookies.

Prepare the bid

The robot checks the current highest bid and raises that by $3 but does not confirm the bid yet. The ${{ ... }} syntax is used to evaluate a Python expression.

Wait until the last moment

The Wait For Elements State keyword waits until it finds an element with the id of time-left and that contains the text 0 seconds. The RPA.Browser.Playwright library supports chaining multiple selector strategies for maximum flexibility when targeting elements (CSS, XPath, text).

Confirm the bid

The confirmation is completed by clicking a button.

Take a screenshot of the result

Finally, the robot takes a screenshot of the result modal.

Technical information

Last updated

December 17, 2022

License

Apache License 2.0