From your history it seems that you might be having internal pile.
Due to passing hard stool it get friction on the pile giving rise to passing frank blood in stool
For passing black specs go for stool test
for occult blood in stool and if it is positive then consult your doctor and take his advice.
Ok and bye.