If using Scrapy, the solution to the problem depends on what the button is doing.
If it’s just showing content that was previously hidden, you can scrape the data without a problem, it doesn’t matter that it wouldn’t appear in the browser, the HTML is still there.
If it’s fetching the content dynamically via AJAX when the button is pressed, the best thing to do is to view the HTTP request that goes out when you press the button using a tool like Firebug. You can then just request the data directly from that URL.
Do I have to use an external library like mechanize or lxml?
If you can give the URL of the page you’re working on scraping I can take a look.