Best Practice to Python OpenDirector Add HTTP Request Header – Python Web Crawler Tutorial
To crawl a web page, we should add some http request headers to our crawler to simulate browser. We can use urllib.request.Request() to build a request object to add some headers to do it. Meanwhile, we also can use urllib.request.build_opener() to create an OpenDirector object to crawl a web page. In this tutorial, we will add some request headers to OpenDirector object to simulate browser.
Best Practice to PHP Output PDF to Browser Directly – PHP Tutorial
To make browser show pdf file, we can use html embed or open a pdf url by browser. However, these two methods of displaying pdf file is hard to make some control, for example, if we only want to valid user to read pdf, how to control? To do this, we need output pdf file by php script. In this tutorial, we will show you how to do.