browser.save_screenshot('screenshot.png')
img = browser.find_element_by_xpath('//*[@id="captcha"]')
loc = img.location
image = cv.LoadImage('screenshot.png', True)
out = cv.CreateImage((150,60), image.depth, 3)
cv.SetImageROI(image, (loc['x'],loc['y'],150,60))
cv.Resize(image, out)
cv.SaveImage('out.jpg', out)
$element = $driver->findElement(WebDriverBy::cssSelector('body'));
$src = $element->getAttribute('innerHTML');
# или так
$src = $driver->executeScript("return document.body.innerHTML");