Question: I have an activity that shows a dialogfragment.
I've already set the dialogfragment cancelable to false, but the underlying activity still captures the back button press.
My underlying activity has overridden the onBackPressed method, but I don't want this to run when the dialogfragment is shown.

How do you disable the back button when dialogfragment is shown?
Do I check from activity onBackPressed method if dialogfragment is shown and ignore the back button press?

Answer: 
```
#!/usr/bin/env python
# coding=utf-8
from bs4 import BeautifulSoup
import requests

url = u'https://ta.wikisource.org/w/index.php?title=அட்டவணை பேச்சு:நாடகக்கலை-2.pdf&action=history'
content = requests.get(url).content
soup = BeautifulSoup(content, 'lxml')
# talkPage1 = soup.findAll(id='mw-content-text')
talkPage2 = soup.find(id='mw-history-compare').find('li')  # narrows it down to list items instead of the whole list

print(talkPage2.text)

```

Output:

```
(நடப்பு | முந்திய) 05:56, 23 பெப்ரவரி 2018‎ Info-farmerBot (பேச்சு | பங்களிப்புகள்)‎ . . (வெற்று) (-4)‎ . . (-) (மீளமை) (அடையாளம்: Blanking)

```

Is this what you were looking for? You were printing the whole list before, I think maybe you meant you were looking for the first *list item* of the list. This is what that looks for.
Add `break` in the `for` loop:

```
#!/usr/bin/env python
# coding=utf-8
from bs4 import BeautifulSoup
import requests

url = u'https://ta.wikisource.org/w/index.php?title=அட்டவணை பேச்சு:நாடகக்கலை-2.pdf&action=history'
content = requests.get(url).content
soup = BeautifulSoup(content,'lxml')
#talkPage1 = soup.findAll(id='mw-content-text')
talkPage2 = soup.findAll(id='mw-history-compare')

for link in talkPage2:
    print(link.text)
    break

```

This will give you only the first line.