AutomateTheBoringStuff.Ch11.Projects package

Submodules

AutomateTheBoringStuff.Ch11.Projects.P1_commandLineEmailer module

Command line emailer

Write a program that takes an email address and string of text on the command line and then, using Selenium, logs into your email account and sends an email of the string to the provided address. (You might want to set up a separate email account for this program.)

Note

  • “string of text” must be within quotes, like shown
  • “new” gmail layout is used with keyboard shortcuts enabled
  • not fully tested because account could end up banned for going against TOS
AutomateTheBoringStuff.Ch11.Projects.P1_commandLineEmailer.main()[source]

AutomateTheBoringStuff.Ch11.Projects.P2_imageDownloader module

Image downloader

Write a program that goes to a photo-sharing site like Flickr or Imgur, searches for a category of photos, and then downloads all the resulting images. You could write a program that works with any photo site that has a search feature.

Note

Many photo-sharing sites do not want direct download links easily accessible. Therefore, it is likely this script will not work in the future.

AutomateTheBoringStuff.Ch11.Projects.P2_imageDownloader.main()[source]

AutomateTheBoringStuff.Ch11.Projects.P3_2048 module

2048

2048 is a simple game where you combine tiles by sliding them up, down, left, or right with the arrow keys. You can actually get a fairly high score by repeatedly sliding in an up, right, down, and left pattern over and over again.

Write a program that will open the game at https://gabrielecirulli.github.io/2048/ and keep sending up, right, down, and left keystrokes to automatically play the game.

class AutomateTheBoringStuff.Ch11.Projects.P3_2048.ElementDoesNotHaveText(locator, text)[source]

Bases: object

Element does not have text

An expectation for checking that an element does not have specified text. Returns the WebElement if it doesn’t have the specified text

locator

Used to find the element

AutomateTheBoringStuff.Ch11.Projects.P3_2048.main()[source]

AutomateTheBoringStuff.Ch11.Projects.P4_linkVerification module

Link verification

Write a program that, given the URL of a web page, will attempt to download every linked page on the page. The program should flag any pages that have a 404 “Not Found” status code and print them out as broken links.

AutomateTheBoringStuff.Ch11.Projects.P4_linkVerification.main()[source]

Module contents