Skip to content

Commit 7bbb0bf

Browse files
committed
Fix regular expression for getting transactions
1 parent fd470da commit 7bbb0bf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/API.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function login($username, $password)
5555
$crawler = $this->client->submit($form);
5656

5757
$accountList = [];
58-
58+
5959
$crawler->filter('.main_group_account_row')->each(function ($account) use (&$accountList) {
6060
$name = $account;
6161
$name = $name->filter('.NicknameField a')->first();
@@ -187,10 +187,10 @@ public function filterTransactions($crawler)
187187
';
188188
$html = $crawler->html();
189189

190-
preg_match_all($pattern, $html, $matches);
190+
preg_match_all('/({"Transactions":(?:.+)})\);/', $html, $matches);
191191

192-
foreach ($matches[0] as $_temp) {
193-
if (strstr($_temp, '{"Transactions"')) {
192+
foreach ($matches[1] as $_temp) {
193+
if (strstr($_temp, 'Transactions')) {
194194
$transactions = json_decode($_temp);
195195
break;
196196
}

0 commit comments

Comments
 (0)