
Research
/Security News
Malicious npm Packages Target WhatsApp Developers with Remote Kill Switch
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
requests
bs4
(BeautifulSoup)git clone https://github.com/pythonshik/ai-html-parser.git
cd ai-html-parser
pip install -r requirements.txt
AI
in the root directory.gemini_api_key
inside the AI
folder.AIparser
class:
from AIparse import AIparser
element = AIparser("https://www.youtube.com/@PythonShik")
for i in ["number of videos", "number of subscribers"]:
parsed_data = element.parse(i)
print(f"{parsed_data['explain']}: {parsed_data['value']}")
{
"value": "96",
"explain": "Number of subscribers",
"result": "96 subscribers"
}
This project is an AI-powered HTML parser designed to extract specific data from web pages using Google Gemini's text generation API. The parser processes the HTML source code of a webpage, identifies specific elements, and returns the desired information in a structured JSON format.
BASE.py
The core class for interacting with Google Gemini's text generation API.
generate()
method.history_add(role, content)
: Adds messages to the conversation history.generate()
: Sends data to gemini API and retrieves the generated text.export_history(filename)
: Saves conversation history to a file.import_history(filename)
: Loads conversation history from a file.clear_history(filename)
: Clears the conversation history.prompts.py
Defines the instruction format for AI tasks.
Instructions
first_instruction
: Provides a detailed guide for parsing HTML elements and formatting the response.main.py
The main entry point for the application.
AIparser
.Gen
class for AI communication.AIparser.__init__
: Initializes the parser with a URL and target element.AIparser.parse(element)
: Parses the given element and retrieves AI-generated results.This tool is ideal for:
Feel free to contribute to the project by submitting issues or pull requests.
This project is licensed under the MIT License.
FAQs
AI HTML Parser
We found that ai-html-parse demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.