Skip to content

Tag: python-3.x

Unable to call function with self

I’m writing a simple code snippet here, but unable to run the code It errors out with “AttributeError: ‘str’ object has no attribute ‘functiona’” Unable to call it with self. However, if I provide test.functiona(a) it works fine. Few of other code samples works with self.fu…

Removing specific word from WebElement text

Hello I am scraping a website using selenium which has a button named view profile whenever i scrape it shows me the text of button in my output because it’s under the same <div> that I am scraping data from like my code its ouput Is there any way I can remove that view profile text or stop it fro…

How to use list() when in an ipdb session?

In a Python 3.5.2 script where I have, e.g., The interpreter hits these lines and drops me into an ipdb session. Understandably, ipdb has limited functionality compared to an iPython interpreter session (e.g., no magic commands). However, I’m surprised to find that some Python built-ins don’t work…

How to read history in ptpython console?

I’ve been trying to figure out how to get save and read in the history of my Python commands in a ptpython console, but haven’t been able to do so. All of my efforts have so far been variations of this answer. However, I still am not able to read in my history. I would simply like to be able