Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 25e7141

Browse files
Changed to display HTML outputs regardless of the response status if the content exits.
1 parent 7b6b8ac commit 25e7141

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

‎ChangeLog.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Change Log
22

3+
### 1.2.1 - 2018年10月23日
4+
- Changed to display HTML outputs regardless of the response status if the content exits.
5+
36
### 1.2.0 - 2018年10月23日
47
- Changed to display the HTML output for the `302` status.
58
- Enabled disk cache of PhantomJS.

‎web/index.php‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Registry {
1010
const SLUG = 'SimpleWebScraper';
1111
const DESCRIPTION = 'PHP & PhantomJS driven web content scraper';
1212
const PROGRAM_URI = 'https://github.com/michaeluno/php-simple-web-scraper';
13-
const VERSION = '1.2.0';
13+
const VERSION = '1.2.1';
1414
const AUTHOR = 'Michael Uno';
1515
const AUTHOR_URI = 'http://en.michaeluno.jp';
1616

@@ -140,7 +140,9 @@ static public function setUp() {
140140
$_oBrowser = new Browser( $_sBinPath, $_sUserAgent, $_aHeaders, $_aClientConfigurations );
141141
$_oBrowser->setRequestArguments( $_aRequestArguments );
142142
$_oResponse = $_oBrowser->get( $_sURL );
143-
if ( in_array( $_oResponse->getStatus(), array( 200, 302 ) ) ) {
143+
$_sContent = $_oResponse->getContent();
144+
// $_oResponse->getStatus()
145+
if ( $_sContent ) {
144146
echo $_oResponse->getContent(); // Dump the requested page content
145147
break;
146148
} else {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /