Question: ```
import pandas as pd
import glob
import csv
import re
from bs4 import BeautifulSoup
links_with_text = []
textfile = open("a_file.txt", "w")
 for filename in glob.iglob('*.html'):
  with open(filename) as f:
    soup = BeautifulSoup(f)

    links_with_text = [a['href'] for a in soup.find_all('a', href=True) if a.text]

    print(links_with_text)

    for element in links_with_text:
      textfile.write(element + "\n")

```

sample Output:

file name:

* link1
* link2
* link3

file name2:

* link1
* link2
* link3

file name3:

* link1
* link2
* link3

I found a post some what related to mine but there it prints the output in multiple text files but here I would like to have those file names with their links in one textfile.

[BeautifulSoup on multiple .html files](https://stackoverflow.com/questions/27634123/beautifulsoup-on-multiple-html-files)

Please suggest. Thank you in advance

Answer: 
Something like this should work:

```
export default function App() {
  return (
    <div className="App">
      <tr>
        <td>Time: {getCurrentTime()}</td>
      </tr>
    </div>
  );
}

export function getCurrentTime () {
  let today = new Date();
  let dateTime = (today.getHours() < 10 ? `0${today.getHours()}` : `${today.getHours()}`) + ':' + (today.getMinutes() < 10 ? `0${today.getMinutes()}` : `${today.getMinutes()}`) + ':' + (today.getSeconds() < 10 ? `0${today.getSeconds()}` : `${today.getSeconds()}`);
  console.log(dateTime);
  return dateTime;
}

```
I did not understand what you meant, but I think you wanted something like that:

```js
const getCurrentTime = () => {
    const date = new Date();
    const hours = date.getHours();
    const minutes = date.getMinutes();
    const seconds = date.getSeconds();
    const timeString = `${hours.toString().length === 1 ? `0${hours}` : hours}:${minutes.toString().length === 1 ? `0${minutes}` : minutes}:${seconds.toString().length === 1 ? `0${seconds}` : seconds}`;
    return timeString;
};

console.log(getCurrentTime())
```