Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using Browserbase: AttributeError: 'SessionCreateResponse' object has no attribute 'load' #888

Open
nom opened this issue Jan 12, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@nom
Copy link

nom commented Jan 12, 2025

Describe the bug
Using browserbase (1.0.5), getting the following error:

  result = smart_scraper_graph.run()
  File "/opt/conda/lib/python3.10/site-packages/scrapegraphai/graphs/smart_scraper_graph.py", line 292, in run
    self.final_state, self.execution_info = self.graph.execute(inputs)
  File "/opt/conda/lib/python3.10/site-packages/scrapegraphai/graphs/base_graph.py", line 358, in execute
    return self._execute_standard(initial_state)
  File "/opt/conda/lib/python3.10/site-packages/scrapegraphai/graphs/base_graph.py", line 303, in _execute_standard
    raise e
  File "/opt/conda/lib/python3.10/site-packages/scrapegraphai/graphs/base_graph.py", line 276, in _execute_standard
    result, node_exec_time, cb_data = self._execute_node(
  File "/opt/conda/lib/python3.10/site-packages/scrapegraphai/graphs/base_graph.py", line 200, in _execute_node
    result = current_node.execute(state)
  File "/opt/conda/lib/python3.10/site-packages/scrapegraphai/nodes/fetch_node.py", line 116, in execute
    return self.handle_web_source(state, source)
  File "/opt/conda/lib/python3.10/site-packages/scrapegraphai/nodes/fetch_node.py", line 298, in handle_web_source
    data = browser_base_fetch(
  File "/opt/conda/lib/python3.10/site-packages/scrapegraphai/docloaders/browser_base.py", line 59, in browser_base_fetch
    result.append(session.load(url, text_content=text_content))
  File "/opt/conda/lib/python3.10/site-packages/pydantic/main.py", line 885, in __getattr__
    raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}') from exc
AttributeError: 'SessionCreateResponse' object has no attribute 'load'

Running

graph_config = {
    "llm": {
        "api_key": "XXX,
        "model": "openai/gpt-4o-mini",
    },
    "verbose": True,
    "headless": False,
    "browser_base": {
        "api_key": "XXX",
        "project_id": "XXX"
    }
}

smart_scraper_graph = SmartScraperGraph(
    prompt="XXX",
    source=XXX,
    config=graph_config
)

Copy link

dosubot bot commented Jan 12, 2025

Hello @nom! I'm here to help you with any bugs, questions, or contributions. Let's take a look at the issue you're experiencing together.

The error you're encountering, AttributeError: 'SessionCreateResponse' object has no attribute 'load', suggests that the SessionCreateResponse object returned by the create method in the Browserbase client does not have a load method. This could be due to changes in the Browserbase module, particularly in version 1.0.5, which might have altered the structure or attributes of the SessionCreateResponse object.

To resolve this issue, you should:

  1. Check the Documentation: Verify the current documentation for the Browserbase module to understand the expected methods and attributes of the SessionCreateResponse object. It's possible that the method to load URLs has changed or been moved to a different object.

  2. Review Recent Changes: Look into the release notes or changelog for version 1.0.5 of the Browserbase module to identify any changes related to session handling or the SessionCreateResponse object.

  3. Update Code: If the method to load URLs has changed, update your code accordingly. You might need to use a different method or object to perform the loading operation.

  4. Contact Support: If the documentation does not clarify the changes, consider reaching out to the maintainers of the Browserbase module for further assistance.

Unfortunately, I couldn't find specific details about the SessionCreateResponse object or recent changes in the repository that could directly address this issue [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@dosubot dosubot bot added the bug Something isn't working label Jan 12, 2025
@Kilowhisky
Copy link

I am also getting this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants