Git Product home page Git Product logo

phantomime's Introduction

Phantomime

phantomime

Phantomime is a Python package that provides a simplified, high-level API for interacting with web pages. It leverages the power of Selenium and Selenium Hub and provides functionality for headless browsing, making it an excellent tool for web scraping, testing, and automation.

Prerequisites

Installation

You can install Phantomime directly from its GitHub repository using pip:

pip install git+https://github.com/psyb0t/phantomime.git#egg=phantomime

Usage

Phantomime provides a variety of functionalities for interacting with web pages. Here is an example of a typical usage scenario:

from phantomime import phantomime

# Start Phantomime with Firefox as the driver
phantomime.start(phantomime.DRIVER_TYPE_FIREFOX)

# Set the page load timeout and window size
phantomime.set_page_load_timeout(30)
phantomime.set_window_size(1280, 720)

# Load a web page
phantomime.load_page("http://psyb0t.github.io/phantomime/test-page/")

Please find the comprehensive usage example here.

Features

  • Page interaction: Phantomime provides functions for loading web pages, scrolling, and checking if a page is ready or if certain text is present on a page.
  • Element selection: Phantomime allows you to find elements by CSS or XPATH selectors.
  • Visibility checks: You can check if an element is visible on the page, or wait for an element to become visible or invisible.
  • iFrame handling: Phantomime allows you to switch to different iFrames within a page and interact with their contents.
  • JS interactions: Phantomime can trigger JavaScript events like clicks and alerts.
  • Cookie manipulation: Phantomime provides functions for adding and deleting cookies.
  • Screenshots: You can take screenshots of the page, either as a base64 string or saved directly to a file.

Troubleshooting

In case of any issues, make sure your Docker Engine is properly installed and running. If you still face issues, you may consider raising an issue in the issues section of the project repository.

License

This software is licensed under the terms of the Do What The Fuck You Want To Public License (WTFPL). This license allows you to use the software for any purposes, without any conditions or restrictions unless such restrictions are required by law. You can learn more about the license at http://www.wtfpl.net/about/.

By using this software, you agree to abide by the terms of the WTFPL. If you do not agree, please do not use, modify, or distribute the software.

phantomime's People

Contributors

dependabot[bot] avatar psyb0t avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.