Skip to content

Commit 1252494

Browse files
committed
add new import
1 parent 908e67f commit 1252494

File tree

4 files changed

+14
-16
lines changed

4 files changed

+14
-16
lines changed

examples/credits_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import os
77
from dotenv import load_dotenv
8-
from scrapegraph_py.credits import credits
8+
from scrapegraph_py import credits
99

1010
# Load environment variables from a .env file
1111
load_dotenv()

examples/scrape_example.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1+
import os
12
from scrapegraph_py.scrape import scrape
2-
from dotenv import load_dotenv # Import load_dotenv
3-
import os # Import os to access environment variables
4-
import json # Import json for beautifying output
3+
from dotenv import load_dotenv
54

6-
def main():
7-
"""Main function to execute the scraping process."""
8-
load_dotenv()
9-
api_key = os.getenv("SCRAPEGRAPH_API_KEY")
10-
url = "https://scrapegraphai.com/"
11-
prompt = "What does the company do?"
125

13-
result = scrape(api_key, url, prompt)
14-
print(result)
15-
if __name__ == "__main__":
16-
main()
6+
load_dotenv()
7+
api_key = os.getenv("SCRAPEGRAPH_API_KEY")
8+
url = "https://scrapegraphai.com/"
9+
prompt = "What does the company do?"
10+
11+
result = scrape(api_key, url, prompt)
12+
print(result)

examples/scrape_schema_example.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1+
import os
12
from pydantic import BaseModel, Field
23
from scrapegraph_py.scrape import scrape
34
from dotenv import load_dotenv
4-
import os
55

6-
# Load environment variables from .env file
76
load_dotenv()
87

98
# Define a Pydantic schema

scrapegraph_py/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from .scrape import scrape
2+
from .credits import credits
3+
from .feedback import feedback

0 commit comments

Comments
 (0)