Coder Social home page Coder Social logo

Comments (7)

Triquetra avatar Triquetra commented on August 11, 2024 1

Thank you for your help. Including request_session=session as a Request argument solved it.

from ruia.

howie6879 avatar howie6879 commented on August 11, 2024 1

never resolves, and must be terminated by Ctrl-C.

Fixed, upgrade ruia-shell to 0.0.4:

pip install -U ruia-shell
# or
pip install git+https://github.com/python-ruia/ruia-shell.git

from ruia.

Triquetra avatar Triquetra commented on August 11, 2024

Also:

poetry add ruia-shell
ruia_shell "https://deck.tk/07Pw8tfr"

never resolves, and must be terminated by Ctrl-C.

from ruia.

howie6879 avatar howie6879 commented on August 11, 2024

This simply hangs without resolution. That is, the request is never resolved, and I must Ctrl-C out of it. Scrapy handles this without issue, but I was hoping to transition to ruia. Any ideas?

Just add a aiohttp session:

import aiohttp
import asyncio
from ruia import Request


async def request_example():
    url = "https://deck.tk/07Pw8tfr"
    params = {
        'name': 'ruia',
    }
    headers = {
        'User-Agent': 'Python3.6',
    }
    async with aiohttp.ClientSession() as session:
        request = Request(url=url, method='GET', params=params, session = session , headers=headers)
        response = await request.fetch()
        json_result = await response.json()
        print(json_result)


if __name__ == '__main__':
    asyncio.get_event_loop().run_until_complete(request_example())

from ruia.

howie6879 avatar howie6879 commented on August 11, 2024

never resolves, and must be terminated by Ctrl-C.

I'll fix this issue soon~

Thanks for your report. :)

from ruia.

Triquetra avatar Triquetra commented on August 11, 2024

This did not seem to resolve the issue for me. It still hangs without resolving the request.

from ruia.

howie6879 avatar howie6879 commented on August 11, 2024

@Triquetra

Notice this line: request = Request(url=url, method='GET', params=params, session = session , headers=headers)

Sorry, I just forgot to pass in session parameters to request

from ruia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.