title: Python delete firefox history
body: <p>I want to clean the history of Chrome and Firefox (Windows 10 x64). What I do is delete the files that store the data. My code work's great for Chrome, but it seems like firefox can't find the path.</p>
  
  <pre><code>def fileDel(paths,item):
  if (os.path.exists(paths)):
      os.remove(paths)
      print "Deleted %s in %s" % (item,paths)
  else:
      print paths
      print "No %s found" % (item)
  </code></pre>
  
  <p>The way I define the paths of the files is below.</p>
  
  <pre><code>firefox_places = os.path.join("C:",os.sep,"Users", users_name, "AppData", "Roaming","Mozilla","Firefox","Profiles", ff_profile ,"places")
  chrome_history_path = os.path.join("C:",os.sep,"Users", users_name, "AppData", "Local","Google","Chrome","User Data","Default","History")
  </code></pre>
  
  <p>The ff_profile is the name of the <code>{random}.default</code> folder.</p>
  
  <pre><code>Firefox Profile Found: qbnoewat.default 
  Deleted Chrome History in C:\Users\marduc\AppData\Local\Google\Chrome\User Data\Default\History
  C:\Users\marduc\AppData\Roaming\Mozilla\Firefox\Profiles\qbnoewat.default\places
  No ff found
  </code></pre>
  
  <p>The absolute path of the file is:
  <code>C:\Users\marduc\AppData\Roaming\Mozilla\Firefox\Profiles\qbnoewat.default\places</code></p>
  
  <p>The path is right but it seems it can't find the file. I also tried to hardcode the exact path but nothing happened. 
  Is there some other way I could do it, or there is something wrong in my path?</p>