fix(engines): remove unsupported lookahead from Google regex
Go's regexp package doesn't support Perl lookahead (?=...). Removing the unnecessary lookahead since each MjjYud div is self-contained. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cdfdb16c26
commit
7969b724de
1 changed files with 1 additions and 1 deletions
|
|
@ -129,7 +129,7 @@ func detectGoogleSorry(resp *http.Response) bool {
|
||||||
func parseGoogleResults(body, query string) []contracts.MainResult {
|
func parseGoogleResults(body, query string) []contracts.MainResult {
|
||||||
var results []contracts.MainResult
|
var results []contracts.MainResult
|
||||||
|
|
||||||
mjjPattern := regexp.MustCompile(`<div[^>]*class="[^"]*MjjYud[^"]*"[^>]*>(.*?)</div>\s*(?=<div[^>]*class="[^"]*MjjYud|$)`)
|
mjjPattern := regexp.MustCompile(`<div[^>]*class="[^"]*MjjYud[^"]*"[^>]*>(.*?)</div>`)
|
||||||
matches := mjjPattern.FindAllStringSubmatch(body, -1)
|
matches := mjjPattern.FindAllStringSubmatch(body, -1)
|
||||||
|
|
||||||
for i, match := range matches {
|
for i, match := range matches {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue