Skip to content

Commit

Permalink
add new import
Browse files Browse the repository at this point in the history
  • Loading branch information
VinciGit00 committed Nov 5, 2024
1 parent 908e67f commit 1252494
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion examples/credits_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import os
from dotenv import load_dotenv
from scrapegraph_py.credits import credits
from scrapegraph_py import credits

# Load environment variables from a .env file
load_dotenv()
Expand Down
22 changes: 9 additions & 13 deletions examples/scrape_example.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import os
from scrapegraph_py.scrape import scrape
from dotenv import load_dotenv # Import load_dotenv
import os # Import os to access environment variables
import json # Import json for beautifying output
from dotenv import load_dotenv

def main():
"""Main function to execute the scraping process."""
load_dotenv()
api_key = os.getenv("SCRAPEGRAPH_API_KEY")
url = "https://scrapegraphai.com/"
prompt = "What does the company do?"

result = scrape(api_key, url, prompt)
print(result)
if __name__ == "__main__":
main()
load_dotenv()
api_key = os.getenv("SCRAPEGRAPH_API_KEY")
url = "https://scrapegraphai.com/"
prompt = "What does the company do?"

result = scrape(api_key, url, prompt)
print(result)
3 changes: 1 addition & 2 deletions examples/scrape_schema_example.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import os
from pydantic import BaseModel, Field
from scrapegraph_py.scrape import scrape
from dotenv import load_dotenv
import os

# Load environment variables from .env file
load_dotenv()

# Define a Pydantic schema
Expand Down
3 changes: 3 additions & 0 deletions scrapegraph_py/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .scrape import scrape
from .credits import credits
from .feedback import feedback

0 comments on commit 1252494

Please sign in to comment.