Which is more efficient ? Fetching data directly from databse or from an HTML page in pandas dataframe?
This depends on a lot of things, namely:

is your database in the same local network as your application server?
is the website used in the same local network as your application server?
how large is the table you have in the website?
how large is your database?
can a user do some trusted changes on the webpage that is not inside the database yet?

All in all, the most common case is that your database is in the same local network as your application server, but there is a lot of data stored in there. So, it is difficult to answer in terms of efficiency, it might be quicker to load data from your local network, but selecting items from the database can be very time-consuming, to such an extent that it will be less efficient than loading data from the webpage. So, to compare efficiency, you will have to do a lot of tests and estimations for the future.
However, there are some other aspects
Server load
If you always load from the database, then you have higher server load, which will affect scalability and even performance when longer database tasks are running, for instance some maintenance cron jobs.
Security
If a hacker sends some valid requests but with wrong data, you might be misled, so you will need to validate any input from users you do not trust. And you should not trust the users generally, trusted users should be the exception.
Data structure
You might cache data for this purpose if you do this with the database and you may use JSON when you send the content of the table to the server, so network communication will not increase.
Network burden
If data is sent from the webpage back, then in the case of usage spikes a lot of data might be sent, which might affect the responsiveness of your application.
I am making graphs using bokeh in python and for that I was calling an HTML page to fetch data inside my dataframe but now I want to fetch data directly from database inside my dataframe. So which method is more efficient?