Back to Rod

Rod comparison with chromedp

lib/examples/compare-chromedp/README.md

0.116.24.5 KB
Original Source

Rod comparison with chromedp

chromedp is one of the most popular drivers for Devtools Protocol.

To help developers who are familiar with chromedp to understand rod better we created side by side examples between rod and chromedp.

To run an example:

  1. clone rod
  2. cd to the folder of an example, such as cd lib/examples/compare-chromedp/click
  3. run go run .
rodchromedpDescription
clickclickuse a selector to click on an element
cookiecookieset a HTTP cookie on requests
download_filedownload_filedo headless file downloads
download_imagedownload_imagedo headless image downloads
emulateemulateemulate a specific device such as an iPhone
evalevalevaluate javascript and retrieve the result
headersheadersset a HTTP header on requests
keyskeyssend key events to an element
logiclogicmore complex logic beyond simple actions
pdfpdfcapture a pdf of a page
proxyproxyauthenticate a proxy server which requires authentication
remoteremoteconnect to an existing DevTools instance using a remote WebSocket URL
screenshotscreenshottake a screenshot of a specific element and of the entire browser viewport
submitsubmitfill out and submit a form
subtreesubtreepopulate and travel a subtree of the DOM
texttextextract text from a specific element
uploaduploadupload a file on a form
visiblevisiblewait until an element is visible

Occasionally, some of these examples may break if the specific websites these examples use get updated. We suggest you create an issue.