Skip to content

Commit

Permalink
Allow to set HTML content
Browse files Browse the repository at this point in the history
  • Loading branch information
spekulatius committed Nov 21, 2020
1 parent 2b0d411 commit 9c50d14
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/phpscraper.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@ public function go(string $url)
$this->current_page = $this->client->request('GET', $url);
}

/**
* Allows to set HTML content to process.
*
* @param string $url
* @param string $content
*/
public function setContent(string $url, string $content)
{
$this->current_page = new \Symfony\Component\DomCrawler\Crawler(
$content,
$url
);
}

/**
* Fetch an asset from a given URL
*
Expand Down

0 comments on commit 9c50d14

Please sign in to comment.