Skip to content

Conversation

@isaacwasserman
Copy link

I noticed that a lot of my searches were returning no results because search() couldn't locate the description, so I made some changes that allow it to return a result as long as the link is found. If the description is not found using -webkit-line-clamp: 2, then it looks for a within the result that has as an immediate child. If this is also unsuccessful, it simply returns a concatenation of all of the visible text within the result. This isn't a perfect solution for human readability, but it's still helpful to AI agents that will make use of this package.

Copy link
Owner

@Nv7-GitHub Nv7-GitHub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It overall looks good, I will try to pull it and test it in a couple of weeks!

result_block = soup.find_all("div", attrs={"class": "g"})
if len(result_block) ==0:
if len(result_block) == 0:
print("Result block empty")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably shouldn't have a print here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants