question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Response blank after being assigned to a Selector

See original GitHub issue
$ scrapy shell "http://httpbin.org/ip"

...

In [1]: print response
<200 http://httpbin.org/ip>

In [2]: sel = Selector(text='', response=response)

In [3]: print sel.response
<200 about:blank>

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
kmikecommented, Jul 29, 2016

@Digenis your patch looks fine.

1reaction
kmikecommented, Jul 27, 2016

@eLRuLL this usage of text argument was never intended AFAIK. You can pass url in base_url argument: scrapy.Selector wraps parsel.Selector to 1) provide backwards compatibility and 2) an ability to pass response instead of text.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does AngularJS include an empty option in select?
In short: the empty option means that no valid model is selected (by valid I mean: from the set of options). You need...
Read more >
empty - CSS-Tricks
The CSS :empty pseudo-class selects any element that does not contain children for a given selector.
Read more >
Selectors - W3C
The case-sensitivity of attribute names and values in selectors depends on the document language. Multiple attribute selectors can be used to refer to...
Read more >
CSS selectors - CSS: Cascading Style Sheets - MDN Web Docs
Selects an element based on the value of its id attribute. There should be only one element with a given ID in a...
Read more >
Selectors | jQuery API Documentation
Selects all elements with the given tag name. Also in: Selectors > Content Filter · :empty Selector. Select all elements that have no...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found